Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates for the unique autonyms test #383

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe( 'languagedata', function () {
duplicateAutonyms.push( language );
}

autonyms.push( autonym );
autonyms.push( autonym.toLowerCase() );
}

return duplicateAutonyms;
Expand Down Expand Up @@ -122,6 +122,7 @@ describe( 'languagedata', function () {
assert.ok( languageData.getAutonym( 'qqq' ), 'Language documentation', 'Language qqq was added with the correct autonym' );
autonyms = languageData.getAutonyms();
assert.strictEqual( autonyms[ 'zu' ], 'isiZulu', 'Correct autonym is returned for Zulu using getAutonyms().' );
assert.deepEqual( doubleAutonyms(), [], 'All languages have distinct autonyms.' );
assert.strictEqual( autonyms[ 'pa' ], undefined, 'Language "pa" is not listed in autonyms, because it is a redirect' );
assert.strictEqual( autonyms[ 'pa-guru' ], 'ਪੰਜਾਬੀ', 'Language "pa-guru" has the correct autonym' );
assert.deepEqual( languagesWithoutAutonym(), [], 'All languages have autonyms.' );
Expand Down Expand Up @@ -180,7 +181,6 @@ describe( 'languagedata', function () {
assert.strictEqual( languageData.isRedirect( 'sr-ec' ), 'sr-cyrl', '"sr-ec" is a redirect to "sr-cyrl"' );
assert.deepEqual( badRedirects(), [], 'All redirects have valid targets.' );
assert.deepEqual( doubleRedirects(), [], 'There are no double redirects.' );
assert.deepEqual( doubleAutonyms(), [], 'All languages have distinct autonyms.' );
assert.strictEqual( languageData.getScript( 'no-such-language' ), 'Zyyy', 'A script for an unknown language is Zyyy - undetermined' );
assert.strictEqual( languageData.getScript( 'ii' ), 'Yiii', 'Correct script of the Yi language was selected' );
} );
Expand Down
Loading