-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benjamin Reed
committed
Aug 4, 2017
1 parent
3a243a5
commit 6897389
Showing
2 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
declare const describe, beforeEach, it, expect; | ||
|
||
import {Comparator, Comparators} from '../../src/api/Comparator'; | ||
|
||
const matches = { | ||
'=': Comparators.EQ, | ||
'==': Comparators.EQ, | ||
'eq': Comparators.EQ, | ||
'!=': Comparators.NE, | ||
'ne': Comparators.NE, | ||
'ilike': Comparators.ILIKE, | ||
'like': Comparators.LIKE, | ||
'>': Comparators.GT, | ||
'gt': Comparators.GT, | ||
'<': Comparators.LT, | ||
'lt': Comparators.LT, | ||
'>=': Comparators.GE, | ||
'ge': Comparators.GE, | ||
'<=': Comparators.LE, | ||
'le': Comparators.LE, | ||
'null': Comparators.NULL, | ||
'isnull': Comparators.NULL, | ||
'notnull': Comparators.NOTNULL | ||
} | ||
|
||
describe('Comparators: Lower-Case', () => { | ||
for (const match in matches) { | ||
const comparator = matches[match]; | ||
it(comparator.label + ' should match ' + match.toLowerCase(), () => { | ||
expect(comparator.matches(match.toLowerCase())).toBeTruthy(); | ||
}); | ||
} | ||
}); | ||
|
||
describe('Comparators: Upper-Case', () => { | ||
for (const match in matches) { | ||
const comparator = matches[match]; | ||
it(comparator.label + ' should match ' + match.toUpperCase(), () => { | ||
expect(comparator.matches(match.toUpperCase())).toBeTruthy(); | ||
}); | ||
} | ||
}); |