Skip to content

Commit

Permalink
🎨 More type algebra and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fennecdjay committed Aug 16, 2019
1 parent 81bfdc0 commit 9dff28e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ ANN static m_bool import_core_libs(const Gwi gwi) {

GWI_BB(gwi_oper_ini(gwi, "Class", "Class", "int"))
GWI_BB(gwi_oper_end(gwi, "==", int_eq))
GWI_BB(gwi_oper_end(gwi, "!=", int_neq))
GWI_BB(gwi_oper_end(gwi, ">=", instr_class_ge))
GWI_BB(gwi_oper_end(gwi, ">", instr_class_gt))
GWI_BB(gwi_oper_end(gwi, "<=", instr_class_le))
Expand Down
8 changes: 8 additions & 0 deletions tests/new/typeof.gw
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<<< typeof(1) == typeof(2) >>>;
<<< typeof(1) != typeof(2) >>>;
<<< typeof(1) > typeof(2) >>>;
<<< typeof(1) >= typeof(2) >>>;
<<< typeof(1) < typeof(2) >>>;
<<< typeof(1) <= typeof(2) >>>;
<<< typeof(1) == Object >>>;
<<< typeof(1) > Object >>>;
2 changes: 2 additions & 0 deletions tests/new/typeof2.gw
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<<< int >>>;
<<< typeof(1) >= int >>>;
9 changes: 9 additions & 0 deletions tests/new/typeof3.gw
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class C {}
class D extends C {}
C c;
D d;
<<< typeof(c) < typeof(d) >>>;
<<< typeof(c) > typeof(d) >>>;
<<< C < D >>>;
<<< C > D >>>;

0 comments on commit 9dff28e

Please sign in to comment.