aboutsummaryrefslogtreecommitdiff
path: root/make/tests/reader.mk
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2014-04-27 17:58:48 -0500
committerJoel Martin <github@martintribe.org>2014-04-27 17:58:48 -0500
commitcc021efe10380039a13da5300990639203450634 (patch)
tree02977d571ee6b42e7d5429ff8e922f183422eeb5 /make/tests/reader.mk
parentb58698b257fb6552e053cd245d63a140d3f7a478 (diff)
downloadmal-cc021efe10380039a13da5300990639203450634.tar.gz
mal-cc021efe10380039a13da5300990639203450634.zip
Add step5/9 tests for impls that support it.
- Also remove broken make/tests/*.mk tests. Not used any more.
Diffstat (limited to 'make/tests/reader.mk')
-rw-r--r--make/tests/reader.mk76
1 files changed, 0 insertions, 76 deletions
diff --git a/make/tests/reader.mk b/make/tests/reader.mk
deleted file mode 100644
index 672d27b..0000000
--- a/make/tests/reader.mk
+++ /dev/null
@@ -1,76 +0,0 @@
-INTERACTIVE = no
-
-include tests/common.mk
-include reader.mk
-
-_tonum = $(call int_decode,$($(1)_value))
-
-$(info Testing READ_STR of numbers)
-$(call assert_eq,2,$(call _tonum,$(call READ_STR,2)))
-$(call assert_eq,12345,$(call _tonum,$(call READ_STR,12345)))
-$(call assert_eq,12345,$(call _tonum,$(call READ_STR,12345 "abc")))
-$(call assert_eq,12345,$(call _tonum,$(call READ_STR,12345"abc")))
-$(call assert_eq,12345,$(call _tonum,$(call READ_STR,12345(1))))
-
-$(info Testing READ_STR of symbols)
-$(call assert_eq,abc,$($(call READ_STR,abc)_value))
-$(call assert_eq,abc,$($(call READ_STR,abc )_value))
-$(call assert_eq,abc,$($(call READ_STR,abc"a str")_value))
-$(call assert_eq,abc,$($(call READ_STR,abc(2 3))_value))
-
-$(info Testing READ_STR of strings)
-$(call assert_eq,a string,$(call str_decode,$($(call READ_STR,"a string")_value)))
-$(call assert_eq,a string (with parens),$(call str_decode,$($(call READ_STR,"a string (with parens)")_value)))
-$(call assert_eq,a string,$(call str_decode,$($(call READ_STR,"a string"())_value)))
-$(call assert_eq,a string,$(call str_decode,$($(call READ_STR,"a string"123)_value)))
-$(call assert_eq,a string,$(call str_decode,$($(call READ_STR,"a string"abc)_value)))
-$(call assert_eq,,$(call str_decode,$($(call READ_STR,"")_value)))
-$(call assert_eq,abc ,$(call str_decode,$($(call READ_STR,"abc ")_value)))
-$(call assert_eq, abc,$(call str_decode,$($(call READ_STR," abc")_value)))
-$(call assert_eq,$$abc,$(call str_decode,$($(call READ_STR,"$$abc")_value)))
-$(call assert_eq,abc$$(),$(call str_decode,$($(call READ_STR,"abc$$()")_value)))
-$(call assert_eq,"xyz",$(call str_decode,$($(call READ_STR,"\"xyz\"")_value)))
-
-$(info Testing READ_STR of lists)
-$(call assert_eq,2,$(call _count,$(call READ_STR,(2 3))))
-$(call assert_eq,2,$(call _tonum,$(call sfirst,$(call READ_STR,(2 3)))))
-$(call assert_eq,3,$(call _tonum,$(call sfirst,$(call srest,$(call READ_STR,(2 3))))))
-L := $(strip $(call READ_STR,(+ 1 2 "str1" "string (with parens) and 'single quotes'")))
-$(call assert_eq,5,$(call _count,$(L)))
-$(call assert_eq,str1,$(call str_decode,$($(call _nth,$(L),3)_value)))
-$(call assert_eq,string (with parens) and 'single quotes',$(call str_decode,$($(call _nth,$(L),4)_value)))
-
-$(info Testing READ_STR of vectors)
-$(call assert_eq,2,$(call _count,$(call READ_STR,[2 3])))
-$(call assert_eq,2,$(call _tonum,$(call sfirst,$(call READ_STR,[2 3]))))
-$(call assert_eq,3,$(call _tonum,$(call sfirst,$(call srest,$(call READ_STR,[2 3])))))
-L := $(strip $(call READ_STR,[+ 1 2 "str1" "string (with parens) and 'single quotes'"]))
-$(call assert_eq,5,$(call _count,$(L)))
-$(call assert_eq,str1,$(call str_decode,$($(call _nth,$(L),3)_value)))
-$(call assert_eq,string (with parens) and 'single quotes',$(call str_decode,$($(call _nth,$(L),4)_value)))
-
-$(info Testing READ_STR of quote/quasiquote)
-$(call assert_eq,quote,$($(call _nth,$(call READ_STR,'1),0)_value)) #'
-$(call assert_eq,1,$(call _tonum,$(call _nth,$(call READ_STR,'1),1))) #'
-$(call assert_eq,quote,$($(call _nth,$(call READ_STR,'(1 2 3)),0)_value)) #'
-$(call assert_eq,3,$(call _tonum,$(call _nth,$(call _nth,$(call READ_STR,'(1 2 3)),1),2))) #'
-
-$(call assert_eq,quasiquote,$($(call _nth,$(call READ_STR,`1),0)_value))
-$(call assert_eq,1,$(call _tonum,$(call _nth,$(call READ_STR,`1),1)))
-$(call assert_eq,quasiquote,$($(call _nth,$(call READ_STR,`(1 2 3)),0)_value))
-$(call assert_eq,3,$(call _tonum,$(call _nth,$(call _nth,$(call READ_STR,`(1 2 3)),1),2)))
-
-$(call assert_eq,unquote,$($(call _nth,$(call READ_STR,~1),0)_value))
-$(call assert_eq,1,$(call _tonum,$(call _nth,$(call READ_STR,~1),1)))
-$(call assert_eq,unquote,$($(call _nth,$(call READ_STR,~(1 2 3)),0)_value))
-$(call assert_eq,3,$(call _tonum,$(call _nth,$(call _nth,$(call READ_STR,~(1 2 3)),1),2)))
-
-$(call assert_eq,splice-unquote,$($(call _nth,$(call READ_STR,~@1),0)_value))
-$(call assert_eq,1,$(call _tonum,$(call _nth,$(call READ_STR,~@1),1)))
-$(call assert_eq,splice-unquote,$($(call _nth,$(call READ_STR,~@(1 2 3)),0)_value))
-$(call assert_eq,3,$(call _tonum,$(call _nth,$(call _nth,$(call READ_STR,~@(1 2 3)),1),2)))
-
-
-.PHONY: all
-all:
- @echo "All tests completed"