Changeset 810
- Timestamp:
- Jul 29, 2012 9:59:49 AM (12 years ago)
- Location:
- trunk/magnolia-tests/src
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/magnolia-tests/src/mutification/Mutification.mg
r666 r810 20 20 var tmp : Integer; 21 21 call two(tmp); 22 assert two() <->tmp;22 assert two() == tmp; 23 23 24 24 call four(tmp); 25 assert four() <->tmp;25 assert four() == tmp; 26 26 27 27 var fortytwo = (one() + one() + one() + one()) * ten() + one() + one(); … … 29 29 call add(tmp, one()); 30 30 call add(tmp, one()); 31 assert fortytwo <->tmp;31 assert fortytwo == tmp; 32 32 } 33 33 } -
trunk/magnolia-tests/src/override/Override.mg
r655 r810 18 18 19 19 procedure check() { 20 assert bar(zero()) <->one() doc{should call procedure bar, returning one};21 assert bar(one()) <->one() doc{should call procedure bar, returning one};22 assert bar(two()) <->one() doc{should call procedure bar, returning one};23 assert foo(zero()) <->one() doc{should call default foo, calling function bar, returning one};24 assert foo(one()) <->one() doc{should call default foo, calling function bar, returning one};25 assert foo(two()) <->one() doc{should call default foo, calling function bar, returning one};20 assert bar(zero()) == one() doc{should call procedure bar, returning one}; 21 assert bar(one()) == one() doc{should call procedure bar, returning one}; 22 assert bar(two()) == one() doc{should call procedure bar, returning one}; 23 assert foo(zero()) == one() doc{should call default foo, calling function bar, returning one}; 24 assert foo(one()) == one() doc{should call default foo, calling function bar, returning one}; 25 assert foo(two()) == one() doc{should call default foo, calling function bar, returning one}; 26 26 var x = one(); 27 27 call bar(x); 28 assert x <->one() doc{should call procedure bar, giving one};28 assert x == one() doc{should call procedure bar, giving one}; 29 29 } 30 30 } … … 40 40 41 41 procedure check() { 42 assert bar(one()) <->zero() doc{should call function bar, returning zero};43 assert bar(zero()) <->zero() doc{should call function bar, returning zero};44 assert bar(two()) <->zero() doc{should call function bar, returning zero};45 assert foo(zero()) <->zero() doc{should call default foo, calling bar, returning zero};46 assert foo(one()) <->zero() doc{should call default foo, calling bar, returning zero};47 assert foo(two()) <->zero() doc{should call default foo, calling bar, returning zero};42 assert bar(one()) == zero() doc{should call function bar, returning zero}; 43 assert bar(zero()) == zero() doc{should call function bar, returning zero}; 44 assert bar(two()) == zero() doc{should call function bar, returning zero}; 45 assert foo(zero()) == zero() doc{should call default foo, calling bar, returning zero}; 46 assert foo(one()) == zero() doc{should call default foo, calling bar, returning zero}; 47 assert foo(two()) == zero() doc{should call default foo, calling bar, returning zero}; 48 48 var x = one(); 49 49 call bar(x); 50 assert x <->one() doc{should call procedure bar, giving one};50 assert x == one() doc{should call procedure bar, giving one}; 51 51 } 52 52 } … … 62 62 63 63 procedure check() { 64 assert bar(zero()) <->one() doc{should call procedure bar, returning one};65 assert bar(one()) <->one() doc{should call procedure bar, returning one};66 assert bar(two()) <->one() doc{should call procedure bar, returning one};67 assert foo(zero()) <->two() doc{should call default foo, calling bar, returning zero};68 assert foo(one()) <->two() doc{should call overridden foo, returning two};69 assert foo(two()) <->two() doc{should call overridden foo, calling bar, returning two};64 assert bar(zero()) == one() doc{should call procedure bar, returning one}; 65 assert bar(one()) == one() doc{should call procedure bar, returning one}; 66 assert bar(two()) == one() doc{should call procedure bar, returning one}; 67 assert foo(zero()) == two() doc{should call default foo, calling bar, returning zero}; 68 assert foo(one()) == two() doc{should call overridden foo, returning two}; 69 assert foo(two()) == two() doc{should call overridden foo, calling bar, returning two}; 70 70 var x = one(); 71 71 call bar(x); 72 assert x <->one() doc{should call procedure bar, giving one};72 assert x == one() doc{should call procedure bar, giving one}; 73 73 } 74 74 } -
trunk/magnolia-tests/src/toplevel/Operators.mg
r744 r810 3 3 axiom renamed(decls : \decllist, decl : \decl, renaming : \renaming) { 4 4 assert decl in decls => decl[renaming] in decls[renaming]; 5 } 6 7 test testRenamed() { 8 assert renamed(A, A.foo, [foo => bar]); 5 9 } 6 10 … … 22 26 } 23 27 24 test testRenamed() {25 assert renamed(A, A.foo, [foo => bar]);26 }27 28 28 concept A = { 29 29 procedure foo() { call foo(); } -
trunk/magnolia-tests/src/toplevel/Renaming.mg
r773 r810 1 1 module toplevel.Renaming; 2 2 /* 3 3 concept A = { 4 4 type A; … … 43 43 assert CDArenamed == CDArenamed2; 44 44 } 45 46 47 implementation RenamingNameClash = { 48 type T; 49 function f(t : T) : T = t; 50 function g(t : T) : T = f(t); 51 }[g => f] 52 */ 53 implementation Foo = 54 on signature { 55 type U; 56 function g(t : T) : T = f(t) ; 57 }[g => f] 58 defines { 59 // function f(t : T) : T = f(t); 60 } 61 62 implementation Bar = on { 63 type T; 64 function f(t : T) : T; 65 } 66 defines {} @ Baz[U => T] 67 68 implementation Baz = on { 69 type U; 70 function f(t : U) : U; 71 } 72 defines { 73 function g(t : U) : U = f(t); 74 } 75 76 77 implementation A = defines { 78 type T; 79 function f(t : T) : T = t; 80 function g(t : T) : T = f(t); 81 } 82 83 implementation B = (defines { 84 type T; 85 function f(t : T) : T = t; 86 function g(t : T) : T = f(t); 87 88 }) + extend A 89 90 /* 91 implementation C = defines { 92 type T; 93 function f(t : T) : T = t; 94 function h(t : T) : T = t; 95 } 96 */
Note:
See TracChangeset
for help on using the changeset viewer.