tests: improve and fix test_for_abuse.nit
authorJean Privat <jean@pryen.org>
Wed, 8 Oct 2014 20:18:43 +0000 (16:18 -0400)
committerJean Privat <jean@pryen.org>
Wed, 8 Oct 2014 20:18:43 +0000 (16:18 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/sav/test_for_abuse.res
tests/test_for_abuse.nit

index 51ef296..f2856be 100644 (file)
@@ -1 +1,4 @@
 # This file is part of NIT ( http://www.nitlanguage.org ).
+f is closed? false
+f is closed? true
+* ** **** *******
index 545440b..cae1cd1 100644 (file)
 
 import for_abuse
 
+var escape_f: nullable IStream = null
 for f in file_open("test_for_abuse.nit") do
+       escape_f = f
        print f.read_line
+       print "f is closed? {f.eof}"
 end
+print "f is closed? {escape_f.eof}"
 
 var array = ["*", "****", "**", "*******"]
 for q in array.sort_fa do
-       q.res = q.b.length <=> q.b.length
+       # IN:
+       #     q.a
+       #     q-b
+       # OUT
+       #     q.res
+       q.res = q.a.length <=> q.b.length
 end
-
+print array.join(" ")