2014-09-28 16:55:01 -04:00
|
|
|
import {describe, it, expect} from 'test_lib/test_lib';
|
|
|
|
|
2014-09-25 17:30:10 -04:00
|
|
|
function same(a, b) {
|
|
|
|
return a === b;
|
|
|
|
}
|
|
|
|
|
2014-09-25 19:53:32 -04:00
|
|
|
function notSame(a, b) {
|
|
|
|
if ((a !== a) && (b !== b)) return true;
|
|
|
|
return a !== b;
|
|
|
|
}
|
|
|
|
|
2014-09-28 16:55:01 -04: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 17:30:10 -04:00
|
|
|
}
|