From 9f30d84f3950a1d48de5abb02e6dede135462012 Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Wed, 26 Oct 2016 12:29:30 -0600 Subject: [PATCH] Add conversion to bool tests as conditionals --- unittests/conversion_to_bool.chai | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 unittests/conversion_to_bool.chai diff --git a/unittests/conversion_to_bool.chai b/unittests/conversion_to_bool.chai new file mode 100644 index 0000000..d5512bf --- /dev/null +++ b/unittests/conversion_to_bool.chai @@ -0,0 +1,17 @@ + +// all we care is that this executes, really + +add_type_conversion(type("int"), type("bool"), fun(int i) { return i != 0; }); + +if (0) { + assert_true(false); +} + +while (0) { + assert_true(false); +} + +for (; 0; ) { + assert_true(false); +} +