From 805753dba47f7ef5b34af9579c1d0486f5f4ea68 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Wed, 13 Oct 2010 12:47:10 -0700 Subject: fixed issue where date copy creates an object instead of date --- test/AngularSpec.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test') diff --git a/test/AngularSpec.js b/test/AngularSpec.js index 1ccdf1c3..e0228e16 100644 --- a/test/AngularSpec.js +++ b/test/AngularSpec.js @@ -21,6 +21,13 @@ describe("copy", function(){ assertSame(arr, copy([], arr)); }); + it("should copy Date", function(){ + var date = new Date(123); + expect(copy(date) instanceof Date).toBeTruthy(); + expect(copy(date).getTime()).toEqual(123); + expect(copy(date) === date).toBeFalsy(); + }); + it("should copy array", function(){ var src = [1, {name:"value"}]; var dst = [{key:"v"}]; -- cgit v1.2.3