tests: add some basic tests for dead method removal/cha/rta
authorJean-Sebastien Gelinas <calestar@gmail.com>
Mon, 7 Dec 2009 05:10:19 +0000 (00:10 -0500)
committerJean Privat <jean@pryen.org>
Mon, 11 Jan 2010 21:52:35 +0000 (16:52 -0500)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

23 files changed:
tests/icode_dmr_if.nit [new file with mode: 0644]
tests/icode_dmr_if.tests [new file with mode: 0644]
tests/icode_dmr_if_alt1.tests [new file with mode: 0644]
tests/icode_dmr_inh.nit [new file with mode: 0644]
tests/icode_dmr_inh.tests [new file with mode: 0644]
tests/icode_dmr_inh_alt1.tests [new file with mode: 0644]
tests/icode_dmr_inh_alt2.tests [new file with mode: 0644]
tests/icode_dmr_inh_alt3.tests [new file with mode: 0644]
tests/icode_dmr_simple.nit [new file with mode: 0644]
tests/icode_dmr_simple.tests [new file with mode: 0644]
tests/icode_dmr_simple_alt1.tests [new file with mode: 0644]
tests/icode_dmr_simple_alt2.tests [new file with mode: 0644]
tests/icode_dmr_simple_alt3.tests [new file with mode: 0644]
tests/sav/icode_dmr_if.sav [new file with mode: 0644]
tests/sav/icode_dmr_if_alt1.sav [new file with mode: 0644]
tests/sav/icode_dmr_inh.sav [new file with mode: 0644]
tests/sav/icode_dmr_inh_alt1.sav [new file with mode: 0644]
tests/sav/icode_dmr_inh_alt2.sav [new file with mode: 0644]
tests/sav/icode_dmr_inh_alt3.sav [new file with mode: 0644]
tests/sav/icode_dmr_simple.sav [new file with mode: 0644]
tests/sav/icode_dmr_simple_alt1.sav [new file with mode: 0644]
tests/sav/icode_dmr_simple_alt2.sav [new file with mode: 0644]
tests/sav/icode_dmr_simple_alt3.sav [new file with mode: 0644]

diff --git a/tests/icode_dmr_if.nit b/tests/icode_dmr_if.nit
new file mode 100644 (file)
index 0000000..cf1ae4c
--- /dev/null
@@ -0,0 +1,17 @@
+
+class A
+       fun foo do
+               print "foo"
+       end
+
+       fun bar do
+               print "bar"
+       end
+end
+
+var a = new A
+if true then
+       a.foo
+#alt1#else
+#alt1# a.bar
+end
diff --git a/tests/icode_dmr_if.tests b/tests/icode_dmr_if.tests
new file mode 100644 (file)
index 0000000..c957da8
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_if::A::foo,has,CALL file::Object::print
+A,icode_dmr_if::A::bar,no,CALL file::Object::print
+A,icode_dmr_if::A::foo,no,ABORT
+A,icode_dmr_if::A::bar,has,ABORT
diff --git a/tests/icode_dmr_if_alt1.tests b/tests/icode_dmr_if_alt1.tests
new file mode 100644 (file)
index 0000000..463fe96
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_if_alt1::A::foo,has,CALL file::Object::print
+A,icode_dmr_if_alt1::A::bar,has,CALL file::Object::print
+A,icode_dmr_if_alt1::A::foo,no,ABORT
+A,icode_dmr_if_alt1::A::bar,no,ABORT
diff --git a/tests/icode_dmr_inh.nit b/tests/icode_dmr_inh.nit
new file mode 100644 (file)
index 0000000..02a1752
--- /dev/null
@@ -0,0 +1,20 @@
+class B
+       fun foo do
+               print "bfoo"
+       end
+end
+
+class A
+special B
+       redef fun foo do
+               print "afoo"
+       end
+end
+
+var o: B
+#alt1#o = new B
+#alt2#o = new B
+#alt3#o = new B
+#alt3#o.foo
+o = new A#!alt2#
+o.foo
diff --git a/tests/icode_dmr_inh.tests b/tests/icode_dmr_inh.tests
new file mode 100644 (file)
index 0000000..c72bcd5
--- /dev/null
@@ -0,0 +1,3 @@
+A,icode_dmr_inh::B::foo,has,CALL file::Object::print
+A,icode_dmr_inh::B::foo,no,ABORT
+B,no-file
diff --git a/tests/icode_dmr_inh_alt1.tests b/tests/icode_dmr_inh_alt1.tests
new file mode 100644 (file)
index 0000000..1e00c54
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_inh_alt1::B::foo,has,CALL file::Object::print
+A,icode_dmr_inh_alt1::B::foo,no,ABORT
+B,icode_dmr_inh_alt1::B::foo,no,CALL file::Object::print
+B,icode_dmr_inh_alt1::B::foo,has,ABORT
diff --git a/tests/icode_dmr_inh_alt2.tests b/tests/icode_dmr_inh_alt2.tests
new file mode 100644 (file)
index 0000000..3ec1976
--- /dev/null
@@ -0,0 +1,3 @@
+A,no-file
+B,icode_dmr_inh_alt2::B::foo,has,CALL file::Object::print
+B,icode_dmr_inh_alt2::B::foo,no,ABORT
diff --git a/tests/icode_dmr_inh_alt3.tests b/tests/icode_dmr_inh_alt3.tests
new file mode 100644 (file)
index 0000000..5a45e05
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_inh_alt3::B::foo,has,CALL file::Object::print
+A,icode_dmr_inh_alt3::B::foo,no,ABORT
+B,icode_dmr_inh_alt3::B::foo,has,CALL file::Object::print
+B,icode_dmr_inh_alt3::B::foo,no,ABORT
diff --git a/tests/icode_dmr_simple.nit b/tests/icode_dmr_simple.nit
new file mode 100644 (file)
index 0000000..5d3e6eb
--- /dev/null
@@ -0,0 +1,16 @@
+
+class A
+       fun foo do
+               #alt2#bar
+               print "foo"
+       end
+
+       fun bar do
+               #alt3#foo
+               print "bar"
+       end
+end
+
+var a = new A
+a.foo
+#alt1#a.bar
diff --git a/tests/icode_dmr_simple.tests b/tests/icode_dmr_simple.tests
new file mode 100644 (file)
index 0000000..4898d0b
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_simple::A::foo,has,CALL file::Object::print
+A,icode_dmr_simple::A::bar,no,CALL file::Object::print
+A,icode_dmr_simple::A::foo,no,ABORT
+A,icode_dmr_simple::A::bar,has,ABORT
diff --git a/tests/icode_dmr_simple_alt1.tests b/tests/icode_dmr_simple_alt1.tests
new file mode 100644 (file)
index 0000000..61fe040
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_simple_alt1::A::foo,has,CALL file::Object::print
+A,icode_dmr_simple_alt1::A::bar,has,CALL file::Object::print
+A,icode_dmr_simple_alt1::A::foo,no,ABORT
+A,icode_dmr_simple_alt1::A::bar,no,ABORT
diff --git a/tests/icode_dmr_simple_alt2.tests b/tests/icode_dmr_simple_alt2.tests
new file mode 100644 (file)
index 0000000..68db1f8
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_simple_alt2::A::foo,has,CALL file::Object::print
+A,icode_dmr_simple_alt2::A::bar,has,CALL file::Object::print
+A,icode_dmr_simple_alt2::A::foo,no,ABORT
+A,icode_dmr_simple_alt2::A::bar,no,ABORT
diff --git a/tests/icode_dmr_simple_alt3.tests b/tests/icode_dmr_simple_alt3.tests
new file mode 100644 (file)
index 0000000..db8392e
--- /dev/null
@@ -0,0 +1,4 @@
+A,icode_dmr_simple_alt3::A::foo,has,CALL file::Object::print
+A,icode_dmr_simple_alt3::A::bar,no,CALL file::Object::print
+A,icode_dmr_simple_alt3::A::foo,no,ABORT
+A,icode_dmr_simple_alt3::A::bar,has,ABORT
diff --git a/tests/sav/icode_dmr_if.sav b/tests/sav/icode_dmr_if.sav
new file mode 100644 (file)
index 0000000..257cc56
--- /dev/null
@@ -0,0 +1 @@
+foo
diff --git a/tests/sav/icode_dmr_if_alt1.sav b/tests/sav/icode_dmr_if_alt1.sav
new file mode 100644 (file)
index 0000000..257cc56
--- /dev/null
@@ -0,0 +1 @@
+foo
diff --git a/tests/sav/icode_dmr_inh.sav b/tests/sav/icode_dmr_inh.sav
new file mode 100644 (file)
index 0000000..cf18a45
--- /dev/null
@@ -0,0 +1 @@
+afoo
diff --git a/tests/sav/icode_dmr_inh_alt1.sav b/tests/sav/icode_dmr_inh_alt1.sav
new file mode 100644 (file)
index 0000000..cf18a45
--- /dev/null
@@ -0,0 +1 @@
+afoo
diff --git a/tests/sav/icode_dmr_inh_alt2.sav b/tests/sav/icode_dmr_inh_alt2.sav
new file mode 100644 (file)
index 0000000..91dd06e
--- /dev/null
@@ -0,0 +1 @@
+bfoo
diff --git a/tests/sav/icode_dmr_inh_alt3.sav b/tests/sav/icode_dmr_inh_alt3.sav
new file mode 100644 (file)
index 0000000..359eb0f
--- /dev/null
@@ -0,0 +1,2 @@
+bfoo
+afoo
diff --git a/tests/sav/icode_dmr_simple.sav b/tests/sav/icode_dmr_simple.sav
new file mode 100644 (file)
index 0000000..257cc56
--- /dev/null
@@ -0,0 +1 @@
+foo
diff --git a/tests/sav/icode_dmr_simple_alt1.sav b/tests/sav/icode_dmr_simple_alt1.sav
new file mode 100644 (file)
index 0000000..3bd1f0e
--- /dev/null
@@ -0,0 +1,2 @@
+foo
+bar
diff --git a/tests/sav/icode_dmr_simple_alt2.sav b/tests/sav/icode_dmr_simple_alt2.sav
new file mode 100644 (file)
index 0000000..1289765
--- /dev/null
@@ -0,0 +1,2 @@
+bar
+foo
diff --git a/tests/sav/icode_dmr_simple_alt3.sav b/tests/sav/icode_dmr_simple_alt3.sav
new file mode 100644 (file)
index 0000000..257cc56
--- /dev/null
@@ -0,0 +1 @@
+foo