From 11ad641b086b2f0d28879def2f2df541bc0e22d3 Mon Sep 17 00:00:00 2001 From: Dan Korostelev Date: Thu, 7 Feb 2019 00:10:51 +0100 Subject: [PATCH] add tests for some Null behaviour (#7755) * add tests for some Null behaviour * make Null actually test something --- tests/unit/src/unit/TestMain.hx | 1 + tests/unit/src/unit/TestNull.hx | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/unit/src/unit/TestNull.hx diff --git a/tests/unit/src/unit/TestMain.hx b/tests/unit/src/unit/TestMain.hx index 909f885cf9f..3033cf80a8d 100644 --- a/tests/unit/src/unit/TestMain.hx +++ b/tests/unit/src/unit/TestMain.hx @@ -78,6 +78,7 @@ class TestMain { new TestArrowFunctions(), new TestCasts(), new TestSyntaxModule(), + new TestNull(), #if !no_pattern_matching new TestMatch(), #end diff --git a/tests/unit/src/unit/TestNull.hx b/tests/unit/src/unit/TestNull.hx new file mode 100644 index 00000000000..475ecd7af99 --- /dev/null +++ b/tests/unit/src/unit/TestNull.hx @@ -0,0 +1,10 @@ +package unit; + +class TestNull extends Test { + var ni:Null = null; // a field to prevent local optimizations + + function test() { + f(ni == 0); + f(0 == ni); + } +}