summaryrefslogtreecommitdiff
path: root/Examples/chicken/constants/test-constants.scm
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/chicken/constants/test-constants.scm')
-rw-r--r--Examples/chicken/constants/test-constants.scm16
1 files changed, 16 insertions, 0 deletions
diff --git a/Examples/chicken/constants/test-constants.scm b/Examples/chicken/constants/test-constants.scm
new file mode 100644
index 0000000..1b10b26
--- /dev/null
+++ b/Examples/chicken/constants/test-constants.scm
@@ -0,0 +1,16 @@
+;; feel free to uncomment and comment sections
+
+(load-library 'example "./constants.so")
+
+(display "starting test ... you will see 'finished' if successful.\n")
+(or (= (ICONST) 42) (exit 1))
+(or (< (abs (- (FCONST) 2.1828)) 0.00001) (exit 1))
+(or (char=? (CCONST) #\x) (exit 1))
+(or (char=? (CCONST2) #\newline) (exit 1))
+(or (string=? (SCONST) "Hello World") (exit 1))
+(or (string=? (SCONST2) "\"Hello World\"") (exit 1))
+(or (< (abs (- (EXPR) (+ (ICONST) (* 3 (FCONST))))) 0.00001) (exit 1))
+(or (= (iconstX) 37) (exit 1))
+(or (< (abs (- (fconstX) 3.14)) 0.00001) (exit 1))
+(display "finished test.\n")
+(exit 0)