Revision: 1176
Author:
fafo...@gmail.com
Date: Tue Jan 27 16:04:08 2015 UTC
Log: Test for readterm reading std_in
https://code.google.com/p/teyjus/source/detail?r=1176
Added:
/branches/ocaml-builtins/source/test/io_tests/readterm
/branches/ocaml-builtins/source/test/io_tests/readterm/readterm.mod
/branches/ocaml-builtins/source/test/io_tests/readterm/readterm.sig
/branches/ocaml-builtins/source/test/io_tests/readterm/readterm_1.sh
Modified:
/branches/ocaml-builtins/TODO_IO
=======================================
--- /dev/null
+++ /branches/ocaml-builtins/source/test/io_tests/readterm/readterm.mod Tue
Jan 27 16:04:08 2015 UTC
@@ -0,0 +1,3 @@
+module readterm.
+
+test1 :- readterm std_in X.
=======================================
--- /dev/null
+++ /branches/ocaml-builtins/source/test/io_tests/readterm/readterm.sig Tue
Jan 27 16:04:08 2015 UTC
@@ -0,0 +1,3 @@
+sig readterm.
+
+type test1 o.
=======================================
--- /dev/null
+++ /branches/ocaml-builtins/source/test/io_tests/readterm/readterm_1.sh
Tue Jan 27 16:04:08 2015 UTC
@@ -0,0 +1,6 @@
+TESTNAME=`basename $0`
+INPUT="3."
+QUERY="readterm std_in X, Y is X + 1."
+EXPECTED="Y = 4
+X = 3"
+gives_result_stdin "$INPUT" "$QUERY" "$EXPECTED" "$TESTNAME"
=======================================
--- /branches/ocaml-builtins/TODO_IO Fri Jan 16 17:31:53 2015 UTC
+++ /branches/ocaml-builtins/TODO_IO Tue Jan 27 16:04:08 2015 UTC
@@ -4,21 +4,24 @@
(that is approx. 16M on a 32bits machine and 2^57 on a 64bits machine.)
Please report an issue if you need more than this.
- The minimum number of characters to be read with the input predicate is
now 1
+- opening a file and binding it to two different variables lead to
unspecified
+ behavior (at some point this should be specified)
-Have a way to test errors displayed on stderr.
-Is Perl's Test the best solution in our case?
+=> Fails if one IO test fails (and provides a way to run all of them
anyway)
+
+For all IO predicates, we should test what happens with an unbound variable
+if a variable of a given type is expected.
open_in
-> behavior OK when:
* opening a correct file
* opening an incorrect file
- * opening two times the same file
+ * opening two times the same file (binding to same and diff variables)
close_in
-> behavior OK when:
* closing an opened file
- * closing a variable of an incorrect type (unbound, string, ...)
* closing two times the same opened file
read