mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-13 20:29:24 +00:00
chore(developer): add four additional test cases
This commit is contained in:
parent
b3398fb941
commit
19da0c73ae
1 changed files with 17 additions and 0 deletions
|
|
@ -94,6 +94,11 @@ describe('Test of String-List', () => {
|
|||
const listItemTwo = initListItem(["abc", "def", "ghi"]);
|
||||
assert.isTrue(listItemOne.isEqual(listItemTwo));
|
||||
});
|
||||
it('isEqual should return false for different ListItems', () => {
|
||||
const listItemOne = initListItem(["abc", "def", "ghi"]);
|
||||
const listItemTwo = initListItem(["abd", "def", "ghi"]);
|
||||
assert.isFalse(listItemOne.isEqual(listItemTwo));
|
||||
});
|
||||
it('isEqual should return false for different length ListItems', () => {
|
||||
const listItemOne = initListItem(["abc", "def"]);
|
||||
const listItemTwo = initListItem(["abc", "def", "ghi"]);
|
||||
|
|
@ -116,6 +121,10 @@ describe('Test of String-List', () => {
|
|||
const listItem = initListItem(["abc", "def", "ghi"]);
|
||||
assert.isTrue(listItem.isEqual(["abc", "def", "ghi"]));
|
||||
});
|
||||
it('isEqual should return false for different ListItem and string[]', () => {
|
||||
const listItem = initListItem(["abc", "def", "ghi"]);
|
||||
assert.isFalse(listItem.isEqual(["abd", "def", "ghi"]));
|
||||
});
|
||||
it('isEqual should return false for different length ListItem and string[]', () => {
|
||||
const listItem = initListItem(["abc", "def"]);
|
||||
assert.isFalse(listItem.isEqual(["abc", "def", "ghi"]));
|
||||
|
|
@ -159,11 +168,19 @@ describe('Test of String-List', () => {
|
|||
const listItem = initListItem(["abc", "def", "ghi"]);
|
||||
assert.deepEqual(listItem.toString(), "abc def ghi");
|
||||
});
|
||||
it('toString should return correct string for empty ListItem', () => {
|
||||
const listItem = new ListItem;
|
||||
assert.deepEqual(listItem.toString(), "");
|
||||
});
|
||||
it('toStringArray should return correct string[]', () => {
|
||||
const source = ["abc", "def", "ghi"];
|
||||
const listItem = initListItem(source);
|
||||
assert.deepEqual(listItem.toStringArray(), source);
|
||||
});
|
||||
it('toStringArray should return correct string[] for empty ListItem', () => {
|
||||
const listItem = new ListItem;
|
||||
assert.deepEqual(listItem.toStringArray(), []);
|
||||
});
|
||||
});
|
||||
|
||||
function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue