From 0682b5464d3f8debd474c2d647e9ca541ddd1ae9 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 4 Nov 2022 21:51:31 +0100 Subject: [PATCH] Add test for == function --- src/CMakeLists.txt | 1 + src/functional-tests/eq.at | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/functional-tests/eq.at diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d748957..42c2bb6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -65,6 +65,7 @@ functionaltest("not") functionaltest("type") functionaltest("if") functionaltest("while") +functionaltest("eq") install(TARGETS apfl DESTINATION lib) install(TARGETS apfl-bin DESTINATION bin) diff --git a/src/functional-tests/eq.at b/src/functional-tests/eq.at new file mode 100644 index 0000000..e577a93 --- /dev/null +++ b/src/functional-tests/eq.at @@ -0,0 +1,40 @@ +===== script ===== +print (== 1 1) +print (== 1 1 1) +print (== 1 2) +print (== 1 1 2) +print (== nil false) +print (== false false) +print (== true false) +print (== [] []) +print (== [1] []) +print (== [1] [2]) +print (== [1] [1]) +print (== [[1]] [[1]]) +print (== "Hello" 'Hello) +print (== "Hello" 'World) +print (== ['foo -> [1 2 3]] ['foo -> [1 2 3]]) +print (== ['foo -> [1 2 3]] ['foo -> [1 2 4]]) +print (== {x -> * x 2} {x -> * x 2}) +f = {x -> * x 2} +print (== f f) + +===== output ===== +true +true +false +false +false +true +false +true +false +false +true +true +true +false +true +false +false +true