2015-02-05 15:58:15 -08:00
|
|
|
import {describe, it, expect} from 'angular2/test_lib';
|
2014-09-28 13:55:01 -07:00
|
|
|
|
2014-09-25 14:30:10 -07:00
|
|
|
function same(a, b) {
|
|
|
|
return a === b;
|
|
|
|
}
|
|
|
|
|
2014-09-25 16:53:32 -07:00
|
|
|
function notSame(a, b) {
|
|
|
|
if ((a !== a) && (b !== b)) return true;
|
|
|
|
return a !== b;
|
|
|
|
}
|
|
|
|
|
2014-09-28 13:55:01 -07:00
|
|
|
export function main() {
|
|
|
|
describe('equals', function() {
|
|
|
|
it('should work', function() {
|
|
|
|
var obj = {};
|
|
|
|
expect(same({}, {}) == false).toBe(true);
|
|
|
|
expect(same(obj, obj) == true).toBe(true);
|
|
|
|
expect(notSame({}, {}) == true).toBe(true);
|
|
|
|
expect(notSame(obj, obj) == false).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
2014-09-25 14:30:10 -07:00
|
|
|
}
|