feat(facade): toUpperCase and toLowerCase
This commit is contained in:
27
modules/angular2/test/facade/lang_spec.js
vendored
27
modules/angular2/test/facade/lang_spec.js
vendored
@ -1,7 +1,7 @@
|
||||
import {describe, it, expect, beforeEach, ddescribe, iit, xit, el} from 'angular2/test_lib';
|
||||
|
||||
import {ListWrapper} from 'angular2/src/facade/collection';
|
||||
import {isPresent, RegExpWrapper, RegExpMatcherWrapper, CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
import {isPresent, RegExpWrapper, RegExpMatcherWrapper, StringWrapper, CONST_EXPR} from 'angular2/src/facade/lang';
|
||||
|
||||
export function main() {
|
||||
describe('RegExp', () => {
|
||||
@ -20,13 +20,34 @@ export function main() {
|
||||
|
||||
expect(indexes).toEqual([1, 4, 8, 9]);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
describe('const', () => {
|
||||
it('should support const expressions both in TS and Dart', () => {
|
||||
const numbers = CONST_EXPR([1, 2, 3]);
|
||||
expect(numbers).toEqual([1, 2, 3]);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
describe('String', () => {
|
||||
var upper, lower;
|
||||
|
||||
beforeEach(() => {
|
||||
upper = 'SOMETHING'
|
||||
lower = 'something';
|
||||
});
|
||||
|
||||
it('should upper case a string', () => {
|
||||
var str = StringWrapper.toUpperCase(lower);
|
||||
|
||||
expect(str).toEqual(upper);
|
||||
});
|
||||
|
||||
it('should lower case a string', () => {
|
||||
var str = StringWrapper.toLowerCase(upper);
|
||||
|
||||
expect(str).toEqual(lower);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user