Skip to content

Commit

Permalink
add tests for some Null<BasicType> behaviour (#7755)
Browse files Browse the repository at this point in the history
* add tests for some Null<BasicType> behaviour

* make Null<T> actually test something
  • Loading branch information
nadako authored Feb 6, 2019
1 parent c6657ea commit 11ad641
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/unit/src/unit/TestMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class TestMain {
new TestArrowFunctions(),
new TestCasts(),
new TestSyntaxModule(),
new TestNull(),
#if !no_pattern_matching
new TestMatch(),
#end
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/src/unit/TestNull.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package unit;

class TestNull extends Test {
var ni:Null<Int> = null; // a field to prevent local optimizations

function test() {
f(ni == 0);
f(0 == ni);
}
}

0 comments on commit 11ad641

Please sign in to comment.