tighten ai-generated tests

This commit is contained in:
Emil Lerch 2025-09-23 12:28:05 -07:00
parent e63f0024ce
commit 150ee53ec7
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -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" {