mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-24 05:05:20 -04:00
(test) add cases to the suite for pronoun parsing from commas
This commit is contained in:
parent
6309daa78c
commit
067a7b4dd9
@ -591,7 +591,7 @@ export class Pronoun {
|
||||
}
|
||||
|
||||
return new Pronoun(
|
||||
m[MORPHEMES[0]],
|
||||
`${m[MORPHEMES[0]]}/${m[MORPHEMES[1]]}`,
|
||||
data[data.length - 1],
|
||||
false,
|
||||
m,
|
||||
|
@ -221,47 +221,47 @@ describe('when configured that slashes cannot contain morphemes', () => {
|
||||
});
|
||||
});
|
||||
|
||||
test('builds generated pronouns from commas', () => {
|
||||
const actual = expect(buildPronoun(pronouns, 'ae,aer,aer,aers,aerself,0,'));
|
||||
actual.toBeDefined();
|
||||
actual.toEqual(new Pronoun(
|
||||
'ae',
|
||||
'',
|
||||
false,
|
||||
{
|
||||
pronoun_subject: 'ae',
|
||||
pronoun_object: 'aer',
|
||||
possessive_determiner: 'aer',
|
||||
possessive_pronoun: 'aers',
|
||||
reflexive: 'aerself',
|
||||
},
|
||||
[false],
|
||||
[false],
|
||||
[],
|
||||
'__generator__',
|
||||
false,
|
||||
));
|
||||
});
|
||||
test('builds generated pronouns from commas with compressed parts', () => {
|
||||
const actual = expect(buildPronoun(pronouns, 'they,!2,aers,!2,'));
|
||||
actual.toBeDefined();
|
||||
actual.toEqual(new Pronoun(
|
||||
'they',
|
||||
'',
|
||||
false,
|
||||
{
|
||||
pronoun_subject: 'they',
|
||||
pronoun_object: 'them',
|
||||
possessive_determiner: 'their',
|
||||
possessive_pronoun: 'aers',
|
||||
reflexive: 'themselves',
|
||||
},
|
||||
[true],
|
||||
[false],
|
||||
[],
|
||||
'__generator__',
|
||||
false,
|
||||
));
|
||||
describe('building generated pronouns from commas', () => {
|
||||
test('succeeds with all parts present', () => {
|
||||
const actual = expect(buildPronoun(pronouns, 'ae,aer,aer,aers,aerself,0,'));
|
||||
actual.toBeDefined();
|
||||
actual.toEqual(generatedPronouns.aer);
|
||||
});
|
||||
test('succeeds with description missing present', () => {
|
||||
const actual = expect(buildPronoun(pronouns, 'ae,aer,aer,aers,aerself,0'));
|
||||
actual.toBeDefined();
|
||||
actual.toEqual(generatedPronouns.aer);
|
||||
});
|
||||
test('succeeds with base pronoun and some custom morphemes', () => {
|
||||
const actual = expect(buildPronoun(pronouns, 'they,!2,aers,!2,'));
|
||||
actual.toBeDefined();
|
||||
actual.toEqual(new Pronoun(
|
||||
'they/them',
|
||||
'',
|
||||
false,
|
||||
{
|
||||
pronoun_subject: 'they',
|
||||
pronoun_object: 'them',
|
||||
possessive_determiner: 'their',
|
||||
possessive_pronoun: 'aers',
|
||||
reflexive: 'themselves',
|
||||
},
|
||||
[true],
|
||||
[false],
|
||||
[],
|
||||
'__generator__',
|
||||
false,
|
||||
));
|
||||
});
|
||||
test('fails when too few parts are given', () => {
|
||||
expect(buildPronoun(pronouns, 'ae,aer,aer,aers,aerself')).toBeUndefined();
|
||||
});
|
||||
test('fails when many few parts are given', () => {
|
||||
expect(buildPronoun(pronouns, 'ae,aer,aer,aers,aerself,aersing,0,')).toBeUndefined();
|
||||
});
|
||||
test('fails when base pronoun is unknown', () => {
|
||||
expect(buildPronoun(pronouns, 's/he,!2,aers,!2,')).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe('builds interchangable pronouns from ampersand', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user