add more tests
This commit is contained in:
20
src/tests.rs
20
src/tests.rs
@@ -2024,4 +2024,24 @@ fn test_queries_on_string_lists()
|
||||
["X = [a, b, c | _]", "Y = _"]]);
|
||||
|
||||
assert_prolog_failure!(&mut wam, "?- partial_string(\"abc\", X), partial_string(\"bc\", Y), X = [a | Y].");
|
||||
|
||||
submit(&mut wam, "matcher([a|X], X) :- matcher2(X, _).
|
||||
matcher([b|X], X) :- matcher2(X, _).
|
||||
|
||||
matcher2([c|X], X).
|
||||
matcher2([d|X], X).");
|
||||
|
||||
assert_prolog_success!(&mut wam, "?- partial_string(\"\", X), matcher(X, Y).",
|
||||
[["X = [a, c | _]", "Y = [c | _]"],
|
||||
["X = [a, d | _]", "Y = [d | _]"],
|
||||
["X = [b, c | _]", "Y = [c | _]"],
|
||||
["X = [b, d | _]", "Y = [d | _]"]]);
|
||||
assert_prolog_success!(&mut wam, "?- partial_string(\"a\", X), matcher(X, Y).",
|
||||
[["X = [a, c | _]", "Y = [c | _]"],
|
||||
["X = [a, d | _]", "Y = [d | _]"]]);
|
||||
assert_prolog_success!(&mut wam, "?- partial_string(\"b\", X), matcher(X, Y).",
|
||||
[["X = [b, c | _]", "Y = [c | _]"],
|
||||
["X = [b, d | _]", "Y = [d | _]"]]);
|
||||
assert_prolog_success!(&mut wam, "?- partial_string(\"bc\", X), matcher(X, Y).",
|
||||
[["X = [b, c | _]", "Y = [c | _]"]]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user