From 75c7b8889a6f5c43d69d7eeb51e3ee31d893b3f4 Mon Sep 17 00:00:00 2001 From: Valentyne Stigloher Date: Mon, 7 Oct 2024 14:54:12 +0200 Subject: [PATCH] (test)(pronouns) ensure that pronouns.null.morphemes contains known morphemes --- locale/ko/config.suml | 6 +----- locale/nl/config.suml | 2 -- locale/yi/config.suml | 6 ------ test/locales/config.test.ts | 17 +++++++++++++++++ 4 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 test/locales/config.test.ts diff --git a/locale/ko/config.suml b/locale/ko/config.suml index aa14d46ac..8283dc601 100644 --- a/locale/ko/config.suml +++ b/locale/ko/config.suml @@ -23,11 +23,7 @@ pronouns: description: '대명사 없음 / 무효 대명사 / 자기 이름' history: '어떤 사람들은 대명사를 사용하지 않고 대신 이름, 이니셜 또는 수동태로 대명사를 생략하는 것을 선호합니다({https://web.archive.org/web/20230326021305/https://www.lgbtqia.wiki/wiki/Nullpronominal=널 의례적인}.' morphemes: - pronoun_subject: '#' - pronoun_object: '#' - possessive_determiner: '#것' - possessive_pronoun: '#꺼' - reflexive: '#자기' + pronoun: '#' examples: [':안드레아', ':S'] emoji: description: '이모티콘 자체 대명사' diff --git a/locale/nl/config.suml b/locale/nl/config.suml index 0994848f5..06f631767 100644 --- a/locale/nl/config.suml +++ b/locale/nl/config.suml @@ -24,7 +24,6 @@ pronouns: accusative: '#' pronominal_poss: '#' predicative_poss: '#e' - reflexive: '#zelf' examples: [':Andrea', ':S'] emoji: description: 'Emojizelf voornaamwoorden' @@ -34,7 +33,6 @@ pronouns: accusative: '#' pronominal_poss: '#' predicative_poss: '#e' - reflexive: '#zelf' examples: ['💫', '💙'] others: 'Andere voornaamwoorden' threeForms: true diff --git a/locale/yi/config.suml b/locale/yi/config.suml index 916ee72a9..23d6eb84b 100644 --- a/locale/yi/config.suml +++ b/locale/yi/config.suml @@ -20,12 +20,6 @@ pronouns: null: description: 'No pronouns / null pronouns / pronounless / nameself' history: 'Some people prefer not using any pronouns, instead being referred by name, initial, or by omitting pronouns with passive voice, see: {https://web.archive.org/web/20230326021305/https://www.lgbtqia.wiki/wiki/Nullpronominal=nullpronominal}.' - morphemes: - pronoun_subject: '#' - pronoun_object: '#' - possessive_determiner: '#''s' - possessive_pronoun: '#''s' - reflexive: '#self' examples: [':Andrea', ':S'] emoji: false others: 'Other pronouns' diff --git a/test/locales/config.test.ts b/test/locales/config.test.ts new file mode 100644 index 000000000..3adb37b8c --- /dev/null +++ b/test/locales/config.test.ts @@ -0,0 +1,17 @@ +import { describe, expect, test } from 'vitest'; +import type { Config } from '~/locale/config.ts'; +import allLocales from '~/locale/locales.ts'; +import { loadSumlFromBase } from '~/server/loader.ts'; + +describe.each(allLocales)('config for $code', async ({ code }) => { + const config = loadSumlFromBase(`locale/${code}/config`) as Config; + + const { default: morphemes } = await import(`../../locale/${code}/pronouns/morphemes.ts`); + + test('pronouns.null.morphemes contain valid morphemes', () => { + if (!config.pronouns.null || config.pronouns.null.morphemes === undefined) { + return; + } + expect(morphemes).toEqual(expect.arrayContaining(Object.keys(config.pronouns.null.morphemes))); + }); +});