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

Tpl test #19

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion c/_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ static char _Table_DSTU_9112_B_uk[] =

static int
_uklatn_register_tables(void) {
int err = 0;
int err = 0;
err = _uklatn_register_table(_TableName_uk_DSTU_9112_A, _Table_uk_DSTU_9112_A);
if (err != 0) { return err; }
err = _uklatn_register_table(_TableName_uk_DSTU_9112_B, _Table_uk_DSTU_9112_B);
Expand Down
2 changes: 1 addition & 1 deletion c/_tests.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Generated by gentests.py, do not edit. */


static const struct _uklatn_test _cyr2lat2cyr_data[] = {
{
u"Україна, Хмельницький",
Expand Down Expand Up @@ -326,4 +327,3 @@ static const struct _uklatn_test _lat2cyr_data[] = {
UklatnTable_DSTU_9112_B,
},
};

1 change: 0 additions & 1 deletion csharp/UkrainianLatin.Tests/UkrainianLatinTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ public void test_c2l_KMU_55(string cyr, string lat) {
string q = tr.Encode(cyr, UkrainianLatin.Table.KMU_55);
Assert.Equal(lat, q);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -333,5 +333,4 @@ void test_KMU_55() {
assertEquals(pair[1], q);
}
}

}
127 changes: 68 additions & 59 deletions js/testuklatn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import assert from "node:assert/strict";
import test from "node:test";
import * as uklatn from "./uklatn.js";


test('DSTU_9112_A', async (t) => {
await t.test('c2lr', () => {
const data = [

const data_c2lr = [
[
"Україна, Хмельницький",
"Ukraïna, Xmeljnycjkyj"
Expand Down Expand Up @@ -74,35 +75,21 @@ test('DSTU_9112_A', async (t) => {
[
"об😎нап😘неп😭нєп🧐нїп😍нюп😀няп",
"ob😎nap😘nep😭njep🧐nïp😍njup😀njap"
]
];
for (const [cyr,lat] of data) {
const q = uklatn.encode(cyr, 'DSTU_9112_A');
assert.equal(q, lat);
const t = uklatn.decode(lat, 'DSTU_9112_A');
assert.equal(t, cyr);
}
});
],
];

await t.test('c2l', () => {
const data = [
const data_c2l = [
[
"в’я в'я",
"v'ja v'ja"
],
[
"Ї ї Й й Ё ё Ў ў",
"Ï ï J j Ö ö Ŭ ŭ"
]
];
for (const [cyr,lat] of data) {
const q = uklatn.encode(cyr, 'DSTU_9112_A');
assert.equal(q, lat);
}
});
],
];

await t.test('l2c', () => {
const data = [
const data_l2c = [
[
"я є ю",
"jA jE jU"
Expand All @@ -122,19 +109,37 @@ test('DSTU_9112_A', async (t) => {
[
"Є́с сЄ́с є́с сє́с Ї́с сЇ́с ї́с сї́с Ю́с сЮ́с ю́с сю́с Я́с сЯ́с я́с ся́с",
"Jés sJés jés sjés Ḯs sḮs ḯs sḯs Jús sJús jús sjús Jás sJás jás sjás"
]
];
for (const [cyr,lat] of data) {
],
];

await t.test('c2lr', () => {
for (const [cyr,lat] of data_c2lr) {
const q = uklatn.encode(cyr, 'DSTU_9112_A');
assert.equal(q, lat);
const t = uklatn.decode(lat, 'DSTU_9112_A');
assert.equal(t, cyr);
}
});

await t.test('c2l', () => {
for (const [cyr,lat] of data_c2l) {
const q = uklatn.encode(cyr, 'DSTU_9112_A');
assert.equal(q, lat);
}
});

await t.test('l2c', () => {
for (const [cyr,lat] of data_l2c) {
const q = uklatn.decode(lat, 'DSTU_9112_A');
assert.equal(q, cyr);
}
});

});


test('DSTU_9112_B', async (t) => {
await t.test('c2lr', () => {
const data = [

const data_c2lr = [
[
"Україна, Хмельницький",
"Ukrajina, Khmeljnycjkyj"
Expand Down Expand Up @@ -202,35 +207,21 @@ test('DSTU_9112_B', async (t) => {
[
"об😎нап😘неп😭нєп🧐нїп😍нюп😀няп",
"ob😎nap😘nep😭njep🧐njip😍njup😀njap"
]
];
for (const [cyr,lat] of data) {
const q = uklatn.encode(cyr, 'DSTU_9112_B');
assert.equal(q, lat);
const t = uklatn.decode(lat, 'DSTU_9112_B');
assert.equal(t, cyr);
}
});
],
];

await t.test('c2l', () => {
const data = [
const data_c2l = [
[
"в’я в'я",
"v'ja v'ja"
],
[
"Ї ї Й й Ё ё Ў ў",
"JI ji J j JOW jow UH uh"
]
];
for (const [cyr,lat] of data) {
const q = uklatn.encode(cyr, 'DSTU_9112_B');
assert.equal(q, lat);
}
});
],
];

await t.test('l2c', () => {
const data = [
const data_l2c = [
[
"я ї є ю г ж х щ ш ч ь",
"jA jI jE jU gH zH kH sHcH sH cH hJ"
Expand All @@ -242,19 +233,37 @@ test('DSTU_9112_B', async (t) => {
[
"Є́с сЄ́с є́с сє́с Ї́с сЇ́с ї́с сї́с Ю́с сЮ́с ю́с сю́с Я́с сЯ́с я́с ся́с",
"Jés sJés jés sjés Jís sJís jís sjís Jús sJús jús sjús Jás sJás jás sjás"
]
];
for (const [cyr,lat] of data) {
],
];

await t.test('c2lr', () => {
for (const [cyr,lat] of data_c2lr) {
const q = uklatn.encode(cyr, 'DSTU_9112_B');
assert.equal(q, lat);
const t = uklatn.decode(lat, 'DSTU_9112_B');
assert.equal(t, cyr);
}
});

await t.test('c2l', () => {
for (const [cyr,lat] of data_c2l) {
const q = uklatn.encode(cyr, 'DSTU_9112_B');
assert.equal(q, lat);
}
});

await t.test('l2c', () => {
for (const [cyr,lat] of data_l2c) {
const q = uklatn.decode(lat, 'DSTU_9112_B');
assert.equal(q, cyr);
}
});

});


test('KMU_55', async (t) => {
await t.test('c2l', () => {
const data = [

const data_c2l = [
[
"Україна, Хмельницький",
"Ukraina, Khmelnytskyi"
Expand Down Expand Up @@ -322,13 +331,13 @@ test('KMU_55', async (t) => {
[
"об😎нап😘неп😭нєп🧐нїп😍нюп😀няп",
"ob😎nap😘nep😭niep🧐nip😍niup😀niap"
]
];
for (const [cyr,lat] of data) {
],
];

await t.test('c2l', () => {
for (const [cyr,lat] of data_c2l) {
const q = uklatn.encode(cyr, 'KMU_55');
assert.equal(q, lat);
}
});

});

Loading