tests: base_attr_iset tests construction check errors
authorJean Privat <jean@pryen.org>
Sat, 25 Jul 2009 17:16:40 +0000 (13:16 -0400)
committerJean Privat <jean@pryen.org>
Sun, 26 Jul 2009 00:10:21 +0000 (20:10 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/base_attr_isset.nit
tests/sav/base_attr_isset_alt3.sav [new file with mode: 0644]
tests/sav/base_attr_isset_alt4.sav [new file with mode: 0644]

index 2b8aed9..bb60f8f 100644 (file)
@@ -55,10 +55,10 @@ class Foo
                show(1)
                _a1 = new Integer(1)
                show(2)
-               _a2 = new Integer(_a1.val + 1)
+               _a2 = new Integer(_a1.val + 1) #!alt3# #!alt4#
                show(3)
        end
-
+               #alt3#
        init nop do end
 end
 
@@ -93,6 +93,11 @@ special Foo
        end
 end
 
+class Baz
+special Foo
+end
+
+#alt4# var b2 = new Baz
 var f = new Foo
 var b = new Bar
 f.run
diff --git a/tests/sav/base_attr_isset_alt3.sav b/tests/sav/base_attr_isset_alt3.sav
new file mode 100644 (file)
index 0000000..6033ed3
--- /dev/null
@@ -0,0 +1,13 @@
+1
+false
+false
+2
+true
+false
+3
+true
+false
+Uninitialized attribute base_attr_isset_alt3::Foo::_a2 at base_attr_isset_alt3::Foo::init for Foo.
+,---- Stack trace -- - -  -
+| base_attr_isset_alt3::Sys::main (alt/base_attr_isset_alt3.nit:100)
+`------------------- - -  -
diff --git a/tests/sav/base_attr_isset_alt4.sav b/tests/sav/base_attr_isset_alt4.sav
new file mode 100644 (file)
index 0000000..514d4ae
--- /dev/null
@@ -0,0 +1,13 @@
+1
+false
+false
+2
+true
+false
+3
+true
+false
+Uninitialized attribute base_attr_isset_alt4::Foo::_a2 at base_attr_isset_alt4::Foo::init for Baz.
+,---- Stack trace -- - -  -
+| base_attr_isset_alt4::Sys::main (alt/base_attr_isset_alt4.nit:99)
+`------------------- - -  -