Reorganize test cases
This commit is contained in:
parent
3a745f2b6e
commit
843f545ceb
271 changed files with 236 additions and 245 deletions
26
ts/test-node/util/isSorted_test.ts
Normal file
26
ts/test-node/util/isSorted_test.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { assert } from 'chai';
|
||||
|
||||
import { isSorted } from '../../util/isSorted';
|
||||
|
||||
describe('isSorted', () => {
|
||||
it('returns true for empty lists', () => {
|
||||
assert.isTrue(isSorted([]));
|
||||
});
|
||||
|
||||
it('returns true for one-element lists', () => {
|
||||
assert.isTrue(isSorted([5]));
|
||||
});
|
||||
|
||||
it('returns true for sorted lists', () => {
|
||||
assert.isTrue(isSorted([1, 2]));
|
||||
assert.isTrue(isSorted([1, 2, 2, 3]));
|
||||
});
|
||||
|
||||
it('returns false for out-of-order lists', () => {
|
||||
assert.isFalse(isSorted([2, 1]));
|
||||
assert.isFalse(isSorted([1, 2, 2, 3, 0]));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue