[Sie-announce] SIEコード [2293] 処理をfor文でまとめておいた

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 1月 12日 (水) 21:36:44 JST


Revision: 2293
          http://sourceforge.jp/projects/sie/svn/view?view=rev&revision=2293
Author:   dhrname
Date:     2011-01-12 21:36:44 +0900 (Wed, 12 Jan 2011)

Log Message:
-----------
処理をfor文でまとめておいた

Modified Paths:
--------------
    trunk/Spec/SvgDomSpec.js

Modified: trunk/Spec/SvgDomSpec.js
===================================================================
--- trunk/Spec/SvgDomSpec.js	2011-01-11 14:18:37 UTC (rev 2292)
+++ trunk/Spec/SvgDomSpec.js	2011-01-12 12:36:44 UTC (rev 2293)
@@ -100,23 +100,15 @@
       expect(s.unitType).toEqual(1);
     });
     /*境界条件を調べておく*/
-    it("should be this for the value, when it calls a newValueSpecifiedUnits method (in case of Number.MAX_VALUE)", function() {
-      s.newValueSpecifiedUnits(1, Number.MAX_VALUE);
-      expect(s.valueInSpecifiedUnits).toEqual(Number.MAX_VALUE);
-      expect(s.value).toEqual(Number.MAX_VALUE);
-      expect(s.valueAsString).toEqual(Number.MAX_VALUE+"");
+    it("should be this for the value, when it calls a newValueSpecifiedUnits method", function() {
+      var t = [Number.MAX_VALUE, Number.MIN_VALUE, 0];
+      for (var i=0,tli=t.length;i<tli;++i) {
+        s.newValueSpecifiedUnits(1, t[i]);
+        expect(s.valueInSpecifiedUnits).toEqual(t[i]);
+        expect(s.value).toEqual(t[i]);
+        expect(s.valueAsString).toEqual(t[i]+"");
+        expect(s.unitType).toEqual(1);
+      }
     });
-    it("should be this for the value, when it calls a newValueSpecifiedUnits method (in case of Number.MIN_VALUE)", function() {
-      s.newValueSpecifiedUnits(1, Number.MIN_VALUE);
-      expect(s.valueInSpecifiedUnits).toEqual(Number.MIN_VALUE);
-      expect(s.value).toEqual(Number.MIN_VALUE);
-      expect(s.valueAsString).toEqual(Number.MIN_VALUE+"");
-    });
-    it("should be this for the value, when it calls a newValueSpecifiedUnits method (in case of 0)", function() {
-      s.newValueSpecifiedUnits(1, 0);
-      expect(s.valueInSpecifiedUnits).toEqual(0);
-      expect(s.value).toEqual(0);
-      expect(s.valueAsString).toEqual("0");
-    });
   });
 });
\ No newline at end of file




Sie-announce メーリングリストの案内
Back to archive index