[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-606-g4554e79
Mildred Ki'Lya
silkensedai at online.fr
Mon Mar 1 01:30:57 UTC 2010
The following commit has been merged in the master branch:
commit 6a6cf488e4b5b1319dda58329f6fec33a0b16649
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date: Fri Oct 9 19:54:20 2009 +0200
Improved tests
diff --git a/run-tests.sh b/run-tests.sh
index 9722d6f..779004f 100755
--- a/run-tests.sh
+++ b/run-tests.sh
@@ -74,7 +74,6 @@ if $op_runcwd; then
res=1
echo
header 80 '*' "$op_testname"
- #echo "******************** $op_testname ********************"
if [ -f test.sh -a -x test.sh ]; then
./test.sh
res=$?
@@ -84,6 +83,8 @@ if $op_runcwd; then
header 80 '*'
if [ $res != 0 ]; then
header 80 ' ' "error: $res"
+ else
+ header 80 ' ' "ok"
fi
echo
exit $res
diff --git a/tests/.gitignore b/tests/.gitignore
index 9733823..255d7b5 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -4,7 +4,6 @@ lib_tests
abstract_string_test
boolean_test
boolean_test2
-boolean_test3
character_test
lib_tests
living_external
diff --git a/tests/ambiguous_protoname/test.sh b/tests/ambiguous_protoname/test.sh
index cf5cb02..ada6bec 100755
--- a/tests/ambiguous_protoname/test.sh
+++ b/tests/ambiguous_protoname/test.sh
@@ -5,7 +5,7 @@ echo "Test if the error message contains non ambiguous prototype names"
expected="Slot \`toto' not found in \`AMBIGUOUS_PROTONAME.PROTO'."
-out="$(lisaac 2>&1)"
+out="$(lisaac -partial 2>&1)"
grep -q "$expected" <<<"$out" || \
{
echo
diff --git a/tests/boolean_test3.li b/tests/boolean_test3/boolean_test3.li
similarity index 100%
rename from tests/boolean_test3.li
rename to tests/boolean_test3/boolean_test3.li
diff --git a/tests/boolean_test3/test.sh b/tests/boolean_test3/test.sh
new file mode 100755
index 0000000..5ca40af
--- /dev/null
+++ b/tests/boolean_test3/test.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+
+echo "Test ( + b:BOOLEAN; b == TRUE) compiles"
+
+compile="$(lisaac boolean_test3 -partial 2>&1)" || {
+ echo
+ echo "$compile"
+ exit 1
+}
+
+exit 0
diff --git a/lib/standard/property/hashable.li b/tests/strict_type_parameter/dynamic_type.li
similarity index 74%
copy from lib/standard/property/hashable.li
copy to tests/strict_type_parameter/dynamic_type.li
index 7e136e6..a92b2d6 100644
--- a/lib/standard/property/hashable.li
+++ b/tests/strict_type_parameter/dynamic_type.li
@@ -18,26 +18,32 @@
// //
// http://isaacproject.u-strasbg.fr/ //
///////////////////////////////////////////////////////////////////////////////
+
Section Header
-
- + name := HASHABLE;
+ + name := DYNAMIC_TYPE;
+ - copyright := "2009 Mildred Ki'Lya <http://ki.lya.online.fr>";
+ - comment := "Test dynamic type";
- - copyright := "2003-2005 Jérome Boutet, 2003-2007 Benoit Sonntag";
-
- - comment :=" .";
-
-Section Inherit
-
- - parent_object:OBJECT := OBJECT;
-
Section Public
-
- - hash_code:INTEGER <-
- // The hash-code value of `Current'.
- (
- deferred;
- // ? { result >= 0 };
- );
+ - get_dynamic_type e:Strict E :E <- E;
+
+ - main <-
+ ( + s:ABSTRACT_STRING;
+ + t:ABSTRACT_STRING;
+ s := "test";
+ t := get_dynamic_type s;
+
+ "dynamic_type = ".print;
+ (t = ABSTRACT_STRING).if {
+ "ABSTRACT_STRING".println;
+ }.elseif {t = STRING} then {
+ "STRING".println;
+ }.elseif {t = STRING_CONSTANT} then {
+ "STRING_CONSTANT".println;
+ } else {
+ "???".println;
+ };
+ );
diff --git a/tests/strict_type_parameter/test.sh b/tests/strict_type_parameter/test.sh
new file mode 100755
index 0000000..fbb27e8
--- /dev/null
+++ b/tests/strict_type_parameter/test.sh
@@ -0,0 +1,23 @@
+#! /bin/sh
+
+
+echo "Test if a Strict parameter type gives you the dynamic type"
+
+expected="dynamic_type = STRING_CONSTANT"
+
+compile="$(lisaac dynamic_type -q -o out.exe 2>&1)" || {
+ echo
+ echo "$compile"
+ exit 1
+}
+
+out="$(./out.exe)"
+grep -q "$expected" <<<"$out" || \
+{
+ echo
+ echo "Expected: $expected"
+ echo "Got: $out"
+ exit 1
+}
+
+exit $?
--
Lisaac compiler
More information about the Lisaac-commits
mailing list