Skip to content

Commit fe161fe

Browse files
committed
Add more reader conditional tests
Signed-off-by: James Hamlin <jfhamlin@gmail.com>
1 parent 1d76844 commit fe161fe

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

pkg/reader/reader.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,10 +1301,6 @@ func (r *Reader) readConditional(eofOK bool, stopRune rune) (any, error) {
13011301
return form, nil
13021302
}
13031303

1304-
// Test cases: topLevel splicing; multiple spliced forms; last form is
1305-
// non-matching conditional; odd number of forms; nested splice; conditional at end of collection;
1306-
// conditional at end of input;
1307-
13081304
// hasFeature reports whether the reader has the given reader
13091305
// conditional feature.
13101306
func (r *Reader) hasFeature(feat any) (bool, error) {
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
;; skip-clj
22
[^#?@(:glj [:foo 'symbol])]
33

4+
[#?@(:glj [splice with #?@(:glj [a nested splice])])]
5+
46
[#?(:clj [no match at end of collection])]
57

68
#?(:clj [no match at end of input])
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[(quote symbol)]
2+
[splice with a nested splice]
23
[]
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
;;;ERROR: <unknown-file>:2:18: read-cond requires an even number of forms
2+
#?(:clj :foo :glj)

0 commit comments

Comments
 (0)