Skip to content

Commit 95329e5

Browse files
committed
add test
1 parent bfe380b commit 95329e5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/translator/test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { assertArrayIncludes } from "@std/assert/array-includes";
44
import { number } from "./number.ts";
55
import { translate } from "./translator.ts";
6+
import { assert } from "@std/assert/assert";
67

78
Deno.test("verb with adverb", () => {
89
const translations = translate("mi toki pona").collect();
@@ -12,6 +13,19 @@ Deno.test("adjective with adverb", () => {
1213
const translations = translate("pona ike").collect();
1314
assertArrayIncludes(translations, ["Badly good"]);
1415
});
16+
Deno.test("no ignored adverb with compound adjective", () => {
17+
const translations = translate("ona li palisa pona").collect();
18+
const incorrectTranslations = [
19+
"They are long and hard",
20+
"They are hard and long",
21+
];
22+
for (const translation of translations) {
23+
assert(
24+
!incorrectTranslations.includes(translation),
25+
`Error at ${translation}`,
26+
);
27+
}
28+
});
1529
Deno.test("numeral translation", () => {
1630
const NUMBER_TESTS = new Map(Object.entries({
1731
"tu tu tu wan": 7,

0 commit comments

Comments
 (0)