-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added information on documentation
- Loading branch information
ADMSK\AVROGAL1
committed
Mar 18, 2021
1 parent
1782957
commit b6317d8
Showing
7 changed files
with
105 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Comparators } from '../src' | ||
|
||
export namespace Comparators_Test { | ||
|
||
import compareByOrder = Comparators.compareByOrder; | ||
import compare = Comparators.compare; | ||
beforeAll(() => { | ||
console.log("Comparators test suite started") | ||
console.time("Execution time took") | ||
}) | ||
|
||
afterAll(() => { | ||
console.log("Comparators test suite finished") | ||
console.timeEnd("Execution time took") | ||
}) | ||
|
||
describe('Check compare by order result', () => { | ||
it('it should return valid result by compare order', () => { | ||
expect(compareByOrder(1, 1)).toEqual(0) | ||
expect(compareByOrder(1, 2)).toEqual(-1) | ||
expect(compareByOrder(2, 1)).toEqual(1) | ||
|
||
expect(compareByOrder('test', 'test')).toEqual(0) | ||
expect(compareByOrder('test', 'retest')).toEqual(1) | ||
expect(compareByOrder('retest', 'test')).toEqual(-1) | ||
|
||
expect(compareByOrder(true, true)).toEqual(0) | ||
expect(compareByOrder(true, false)).toEqual(1) | ||
expect(compareByOrder(false, true)).toEqual(-1) | ||
}) | ||
}) | ||
|
||
describe('Check compare result', () => { | ||
it('it should return valid result by compare', () => { | ||
expect(compare(1, 1)).toEqual(-0) | ||
expect(compare(1, 2)).toEqual(-1) | ||
expect(compare(2, 1)).toEqual(1) | ||
|
||
expect(compare('test', 'test')).toEqual(-0) | ||
expect(compare('test', 'retest')).toEqual(1) | ||
expect(compare('retest', 'test')).toEqual(-1) | ||
|
||
expect(compare(true, true)).toEqual(-0) | ||
expect(compare(true, false)).toEqual(1) | ||
expect(compare(false, true)).toEqual(-1) | ||
}) | ||
}) | ||
} |