summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Gran <spk121@yahoo.com>2009-04-24 20:27:36 -0700
committerMichael Gran <spk121@yahoo.com>2009-04-24 20:27:36 -0700
commitcca0264be4c44ede8fecdad0100c298b41a832c2 (patch)
tree67f9ba65e321b8af1e19f7cbd7f1419e24570462
parented9ba980a3d54529ac86cd8b99877a5e9825a51b (diff)
downloadguile-cca0264be4c44ede8fecdad0100c298b41a832c2.tar.gz
Clarify test for symbol syntax
* symbols.test ("symbol syntax"): Clarificaions to tests of syntax symbols.
-rw-r--r--test-suite/tests/symbols.test37
1 files changed, 26 insertions, 11 deletions
diff --git a/test-suite/tests/symbols.test b/test-suite/tests/symbols.test
index be4e2da82..8598761ff 100644
--- a/test-suite/tests/symbols.test
+++ b/test-suite/tests/symbols.test
@@ -94,7 +94,11 @@
;;; lexical syntax of identifiers
;;;
-(define (legit x)
+(define (legit-r6rs x)
+ (expect-fail-exception (string-append x " is invalid") exception:read-error
+ (with-input-from-string x read)))
+
+(define (legit-guile-extension x)
(expect-fail-exception (string-append x " is invalid") exception:read-error
(with-input-from-string x read)))
@@ -102,23 +106,34 @@
(pass-if-exception (string-append x " is invalid") exception:read-error
(with-input-from-string x read)))
-(define (should-be-invalid x)
- (pass-if (string-append x " is invalid")
- (throw 'unresolved)))
(with-test-prefix "symbol syntax"
(with-test-prefix "1-character ASCII identifiers"
- (map legit (list "'!" "'$" "'%" "'&" "'*" "'/" "':" "'<" "'=" "'>" "'?"
- "'^" "'_" "'~"))
- (map should-be-invalid (list "'+" "'-" "'." "'0" "'@" "'[" "']" "'{"
- "'|" "'}"))
+ (map legit-r6rs
+ (append
+ ;; special initial
+ (list "'!" "'$" "'%" "'&" "'*" "'/" "':" "'<" "'=" "'>" "'?"
+ "'^" "'_" "'~")
+ ;; "peculiar" identifiers
+ (list "'+" "'-" "'.")))
+
+ (map legit-guile-extension (list "'0" "'@" "'[" "']" "'{" "'|" "'}"))
+
(map invalid (list "'\"" "'#" "'\\")))
(with-test-prefix "2-character ASCII identifiers"
- (map legit (list "'A!" "'A$" "'A%" "'A&" "'A*" "'A+" "'A-" "'A." "'A/"
- "'A:" "'A<" "'A=" "'A"))
- (map should-be-invalid (list "'a\"" "'a#" "'a[" "'a]" "'a{" "'a|" "'a}"))
+
+ (map legit-r6rs
+ (append
+ ;; special initial
+ (list "'A!" "'A$" "'A%" "'A&" "'A*" "'A/" "'A:" "'A<" "'A="
+ "'A>" "'A?" "'A^" "'A_" "'A~")
+ ;; special subsequent
+ (list "'A+" "'A-" "'A." "'@")))
+
+ (map legit-guile-extension (list "'a\"" "'a#" "'a[" "'a]" "'a{" "'a|" "'a}"))
+
(map invalid (list "'a\\")))
(with-test-prefix "inline hex escapes"