Skip to content

Commit

Permalink
fix test for new define rules
Browse files Browse the repository at this point in the history
  • Loading branch information
ego-lay-atman-bay committed Jan 11, 2024
1 parent 33d43fa commit d28f0c7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/syntax.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,24 +777,24 @@ describe("define hats", () => {
}

test("empty", () => {
const b = parseBlock("define")
const b = parseBlock("define {}")
expect(b.info).toMatchObject(defineHat)
})

test("en", () => {
expect(parseBlock("define foo (bar) quxx").info).toMatchObject(defineHat)
expect(parseBlock("define {foo (bar) quxx}").info).toMatchObject(defineHat)
})

test("translate en -> de", () => {
const b = parseBlock("define foo (bar) quxx")
const b = parseBlock("define {foo (bar) quxx}")
b.translate(allLanguages.de)
// TODO omit custom-arg here
expect(b.stringify()).toEqual("Definiere foo (bar :: custom-arg) quxx")
})

test("de", () => {
expect(
parseBlock("Definiere foo (bar) quxx", optionsFor("de")).info,
parseBlock("Definiere {foo (bar) quxx}", optionsFor("de")).info,
).toMatchObject(defineHat)
})

Expand All @@ -815,19 +815,19 @@ describe("define hats", () => {
selector: "setSizeTo:",
})
expect(
parseBlock("defina foo (bar) quxx", optionsFor("pt_br")).info,
parseBlock("defina {foo (bar) quxx}", optionsFor("pt_br")).info,
).toMatchObject(defineHat)
})

test("rap: three-word define prefix", () => {
expect(
parseBlock("haka tano te foo (bar) quxx", optionsFor("rap")).info,
parseBlock("haka tano te {foo (bar) quxx}", optionsFor("rap")).info,
).toMatchObject(defineHat)
})

test("uz: two-word define suffix", () => {
expect(
parseBlock("foo (bar) quxx ni belgilash", optionsFor("uz")).info,
parseBlock("{foo (bar) quxx} ni belgilash", optionsFor("uz")).info,
).toMatchObject(defineHat)
})
})
Expand Down

0 comments on commit d28f0c7

Please sign in to comment.