summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-23 00:12:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-23 00:12:46 -0700
commit0d8638e43da65169c3d46273c6c9c8239f54723f (patch)
tree49865cd42a717e3325adc068b2101574622705a3
parent502c6b4d4a1e29c51c80a39a6eaef27a3f5c0d89 (diff)
downloadtxr-0d8638e43da65169c3d46273c6c9c8239f54723f.tar.gz
txr-0d8638e43da65169c3d46273c6c9c8239f54723f.tar.bz2
txr-0d8638e43da65169c3d46273c6c9c8239f54723f.zip
tests: squelch unused variable warnings.
* tests/011/patmatch.tl, * tests/019/pct-fun.tl: Disable unused warnings around file self-compilation. * tests/011/tree-bind.tl: Fix one unused variable instance using interned symbol. * tests/011/compile.tl: Disable unused warnings around all file compilation. * tests/012/lambda.tl: Use the parameter of one trivial lambda. * tests/common.tl: Disable unused warnings around compiled tests.
-rw-r--r--tests/011/patmatch.tl3
-rw-r--r--tests/011/tree-bind.tl2
-rw-r--r--tests/012/compile.tl3
-rw-r--r--tests/012/lambda.tl2
-rw-r--r--tests/019/pct-fun.tl3
-rw-r--r--tests/common.tl41
6 files changed, 29 insertions, 25 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl
index 81cda935..5e8d3f7f 100644
--- a/tests/011/patmatch.tl
+++ b/tests/011/patmatch.tl
@@ -552,7 +552,8 @@
(compile-only
(eval-only
- (compile-file (base-name *load-path*) "temp.tlo")
+ (with-compile-opts (nil unused)
+ (compile-file (base-name *load-path*) "temp.tlo"))
(remove-path "temp.tlo")))
(mtest
diff --git a/tests/011/tree-bind.tl b/tests/011/tree-bind.tl
index 83fcaa33..ac55cc07 100644
--- a/tests/011/tree-bind.tl
+++ b/tests/011/tree-bind.tl
@@ -10,7 +10,7 @@
(tree-bind (t : b) '(1 2) b) 2
(tree-bind (b : t) '(1) b) 1
(tree-bind (b : (t 2)) '(1) b) 1
- (tree-bind (b : (a 2 t)) '(1) a) 2
+ (tree-bind (#:b : (a 2 t)) '(1) a) 2
(let ((i 0)) (tree-bind (b : (t (inc i) t)) '(1) (cons i b))) (1 . 1)
(let ((i 0)) (tree-bind (b : (t (inc i) t)) '(1 2) (cons i b))) (0 . 1))
diff --git a/tests/012/compile.tl b/tests/012/compile.tl
index 9b22d92a..b79d92f4 100644
--- a/tests/012/compile.tl
+++ b/tests/012/compile.tl
@@ -10,5 +10,6 @@
(when (path-exists-p exf)
(file-append-string %expected-file%
(file-get-string exf))))
- (compile-file `@f.tl` "temp.tlo")
+ (with-compile-opts (nil unused)
+ (compile-file `@f.tl` "temp.tlo"))
(remove-path "temp.tlo"))
diff --git a/tests/012/lambda.tl b/tests/012/lambda.tl
index 47b03e4b..ec3b2cae 100644
--- a/tests/012/lambda.tl
+++ b/tests/012/lambda.tl
@@ -126,7 +126,7 @@
[(lambda (x y : (a 3) (b 4) . r) (list x y a b r)) 1 2 0 0 . vc] (1 2 0 0 (: : : :))
[(lambda (x y : (a 3) (b 4) . r) (list x y a b r)) 1 2 0 0 5 . vc] (1 2 0 0 (5 : : : :)))
-(test (functionp (lambda (: (n n)))) t)
+(test (functionp (lambda (: (n n)) n)) t)
(defvarl n)
diff --git a/tests/019/pct-fun.tl b/tests/019/pct-fun.tl
index eae0d9bb..6e45f299 100644
--- a/tests/019/pct-fun.tl
+++ b/tests/019/pct-fun.tl
@@ -37,5 +37,6 @@
(compile-only
(eval-only
- (compile-file (base-name *load-path*) "temp.tlo")
+ (with-compile-opts (nil unused)
+ (compile-file (base-name *load-path*) "temp.tlo"))
(remove-path "temp.tlo")))
diff --git a/tests/common.tl b/tests/common.tl
index dbd4ef24..e6697f47 100644
--- a/tests/common.tl
+++ b/tests/common.tl
@@ -9,26 +9,27 @@
(if-match (quote @(as sym @(or :error :warning))) expected
(set expected sym))
(if *compile-test*
- (if (meq expected :error :warning)
- (with-gensyms (code)
- ^(let ((,code (catch
- (compile-toplevel ',expr)
- (error (exc)
- (if (eq ,expected :warning)
- (error "test case ~s produced error during compilation, expected ~s"
- ',expr ,expected)))
- (warning (exc)
- (if (eq ,expected :error)
- (error "test case ~s warned during compilation, expected ~s"
- ',expr ,expected))))))
- (ifa (not (equal (error-to-sym (call ,code)) ,expected))
- (error "test case ~s failed: produced ~s; expected ~s"
- ',expr it ,expected))))
- (with-gensyms (expval)
- ^(let ((,expval ,expected))
- (ifa (not (equal (call (compile-toplevel ',expr)) ,expval))
- (error "test case ~s failed: produced ~s; expected ~s"
- ',expr it ,expval)))))
+ (with-compile-opts (nil unused)
+ (if (meq expected :error :warning)
+ (with-gensyms (code)
+ ^(let ((,code (catch
+ (compile-toplevel ',expr)
+ (error (exc)
+ (if (eq ,expected :warning)
+ (error "test case ~s produced error during compilation, expected ~s"
+ ',expr ,expected)))
+ (warning (exc)
+ (if (eq ,expected :error)
+ (error "test case ~s warned during compilation, expected ~s"
+ ',expr ,expected))))))
+ (ifa (not (equal (error-to-sym (call ,code)) ,expected))
+ (error "test case ~s failed: produced ~s; expected ~s"
+ ',expr it ,expected))))
+ (with-gensyms (expval)
+ ^(let ((,expval ,expected))
+ (ifa (not (equal (call (compile-toplevel ',expr)) ,expval))
+ (error "test case ~s failed: produced ~s; expected ~s"
+ ',expr it ,expval))))))
(if (meq expected :error :warning)
(catch
(let ((expr-expn (expand expr env)))