File tree 4 files changed +8
-6
lines changed
test/clojure/test_clojure
4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ public class EdnReader{
24
24
25
25
static IFn [] macros = new IFn [256 ];
26
26
static IFn [] dispatchMacros = new IFn [256 ];
27
- static Pattern symbolPat = Pattern .compile ("[:]?([\\ D&&[^/]].*/)?([\\ D&&[^/]][^/]*)" );
27
+ static Pattern symbolPat = Pattern .compile ("[:]?+ ([\\ D&&[^/]].*/)?([\\ D&&[^/]][^/]*)" );
28
28
static Pattern intPat =
29
29
Pattern .compile (
30
30
"([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?" );
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ public class LispReader{
59
59
static IFn [] macros = new IFn [256 ];
60
60
static IFn [] dispatchMacros = new IFn [256 ];
61
61
//static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^:/]][^:/]*/)?[\\D&&[^:/]][^:/]*");
62
- static Pattern symbolPat = Pattern .compile ("[:]?([\\ D&&[^/]].*/)?(/|[\\ D&&[^/]][^/]*)" );
62
+ static Pattern symbolPat = Pattern .compile ("[:]?+ ([\\ D&&[^/]].*/)?(/|[\\ D&&[^/]][^/]*)" );
63
63
//static Pattern varPat = Pattern.compile("([\\D&&[^:\\.]][^:\\.]*):([\\D&&[^:\\.]][^:\\.]*)");
64
64
//static Pattern intPat = Pattern.compile("[-+]?[0-9]+\\.?");
65
65
static Pattern intPat =
Original file line number Diff line number Diff line change 324
324
:set #{3 2 1 }
325
325
:set (sorted-set 2 1 3 ))))
326
326
(testing " test number equivalence"
327
- (is (= :1 (case 1N 1 :1 :else ))))
327
+ (is (= :one (case 1N 1 :one :else ))))
328
328
(testing " test warn when boxing/hashing expr for all-ints case"
329
329
(should-print-err-message
330
330
#"Performance warning, .*:\d + - case has int tests, but tested expression is not primitive..*\r ?\n "
348
348
(should-not-reflect (Long. (case 1 1 1 ))) ; new Long(long)
349
349
(should-not-reflect (Long. (case 1 1 " 1" )))) ; new Long(String)
350
350
(testing " non-equivalence of chars and nums"
351
- (are [result input] (= result (case input 97 :97 :else ))
351
+ (are [result input] (= result (case input 97 :got97 :else ))
352
352
:else \a
353
353
:else (char \a)
354
- :97 (int \a))
354
+ :got97 (int \a))
355
355
(are [result input] (= result (case input \a :a :else ))
356
356
:else 97
357
357
:else 97N
Original file line number Diff line number Diff line change 353
353
(are [err msg form] (thrown-with-msg? err msg (read-string form))
354
354
Exception #"Invalid token: foo:" " foo:"
355
355
Exception #"Invalid token: :bar/" " :bar/"
356
- Exception #"Invalid token: ::does.not/exist" " ::does.not/exist" ))
356
+ Exception #"Invalid token: ::does.not/exist" " ::does.not/exist"
357
+ Exception #"Invalid token: :5" " :5" ))
358
+
357
359
; ; Lists
358
360
359
361
(deftest t-Lists )
You can’t perform that action at this time.
0 commit comments