tighten ai-generated tests
This commit is contained in:
parent
e63f0024ce
commit
150ee53ec7
1 changed files with 12 additions and 4 deletions
16
src/root.zig
16
src/root.zig
|
@ -635,11 +635,15 @@ test "adaptiveParse successful without replacements" {
|
||||||
|
|
||||||
const action_words = try tree.sentenceAction();
|
const action_words = try tree.sentenceAction();
|
||||||
defer std.testing.allocator.free(action_words);
|
defer std.testing.allocator.free(action_words);
|
||||||
try std.testing.expect(action_words.len > 0);
|
try std.testing.expect(action_words.len == 2);
|
||||||
|
try std.testing.expectEqualStrings("turn", action_words[0]);
|
||||||
|
try std.testing.expectEqualStrings("on", action_words[1]);
|
||||||
|
|
||||||
const object_words = try tree.sentenceObject();
|
const object_words = try tree.sentenceObject();
|
||||||
defer std.testing.allocator.free(object_words);
|
defer std.testing.allocator.free(object_words);
|
||||||
try std.testing.expect(object_words.len > 0);
|
try std.testing.expect(object_words.len == 2);
|
||||||
|
try std.testing.expectEqualStrings("kitchen", object_words[0]);
|
||||||
|
try std.testing.expectEqualStrings("light", object_words[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "adaptiveParse with word replacement" {
|
test "adaptiveParse with word replacement" {
|
||||||
|
@ -660,11 +664,15 @@ test "adaptiveParse with word replacement" {
|
||||||
|
|
||||||
const action_words = try tree.sentenceAction();
|
const action_words = try tree.sentenceAction();
|
||||||
defer std.testing.allocator.free(action_words);
|
defer std.testing.allocator.free(action_words);
|
||||||
try std.testing.expect(action_words.len > 0);
|
try std.testing.expect(action_words.len == 2);
|
||||||
|
try std.testing.expectEqualStrings("turn", action_words[0]);
|
||||||
|
try std.testing.expectEqualStrings("on", action_words[1]);
|
||||||
|
|
||||||
const object_words = try tree.sentenceObject();
|
const object_words = try tree.sentenceObject();
|
||||||
defer std.testing.allocator.free(object_words);
|
defer std.testing.allocator.free(object_words);
|
||||||
try std.testing.expect(object_words.len > 0);
|
try std.testing.expect(object_words.len == 2);
|
||||||
|
try std.testing.expectEqualStrings("kitchen", object_words[0]);
|
||||||
|
try std.testing.expectEqualStrings("light", object_words[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
test "adaptiveParse no valid parse" {
|
test "adaptiveParse no valid parse" {
|
||||||
|
|
Loading…
Add table
Reference in a new issue