Permalink
Browse files

fix-fiveam-test-comparisons

Ignore-this: 7fb473839da0e7ffbf84b6b4088cb91c

FiveAM would like the expected value to be before the computed value, for
best printing when tests fail.  I reversed the arguments to the
JSON-NUMBER test to agree with this convention.

darcs-hash:20121104214932-b37ea-135ea0b936bb9bc2d004a61599d964ee61389951.gz
  • Loading branch information...
1 parent 2fa6c36 commit 2252c92e777a4be15db568968d3d4f29e8479b2e @rpgoldman rpgoldman committed Nov 4, 2012
Showing with 15 additions and 15 deletions.
  1. +15 −15 t/testdecoder.lisp
View
@@ -241,29 +241,29 @@ safe-symbols-parsing function here for a cure."
,@body)))
(test json-number
- (is (= (decode-json-from-string "100") 100))
- (is (= (decode-json-from-string "10.01") 10.01))
- (is (= (decode-json-from-string "-2.3") -2.3))
- (is (= (decode-json-from-string "-2.3e3") -2.3e3))
- (is (= (decode-json-from-string "-3e4") -3e4))
- (is (= (decode-json-from-string "3e4") 3e4))
+ (is (= 100 (decode-json-from-string "100")))
+ (is (= 10.01 (decode-json-from-string "10.01")))
+ (is (= -2.3 (decode-json-from-string "-2.3")))
+ (is (= -2.3e3 (decode-json-from-string "-2.3e3")))
+ (is (= -3e4 (decode-json-from-string "-3e4")))
+ (is (= 3e4 (decode-json-from-string "3e4")))
(let ((*read-default-float-format* 'double-float))
- (is (= (decode-json-from-string "2e40") 2d40)))
+ (is (= 2d40 (decode-json-from-string "2e40"))))
#-(or (and sbcl darwin) (and allegro macosx))
- (is (equalp (with-fp-overflow-handler
+ (is (equalp "BIG:2e444"
+ (with-fp-overflow-handler
(invoke-restart 'bignumber-string "BIG:")
- (decode-json-from-string "2e444"))
- "BIG:2e444"))
+ (decode-json-from-string "2e444"))))
#-(or (and sbcl darwin) (and allegro macosx))
- (is (= (with-fp-overflow-handler
+ (is (= (* 2 (expt 10 444))
+ (with-fp-overflow-handler
(invoke-restart 'rational-approximation)
- (decode-json-from-string "2e444"))
- (* 2 (expt 10 444))))
+ (decode-json-from-string "2e444"))))
;; In SBCL on Darwin, constructing the float from parts by explicit
;; operations yields #.SB-EXT:SINGLE-FLOAT-POSITIVE-INFINITY.
#+(and sbcl darwin)
- (is (= (decode-json-from-string "2e444")
- (* 2.0 (expt 10.0 444)))))
+ (is (= (* 2.0 (expt 10.0 444))
+ (decode-json-from-string "2e444"))))
(defparameter *json-test-files-path*

0 comments on commit 2252c92

Please sign in to comment.