summaryrefslogtreecommitdiff
path: root/Examples/test-suite/d/bools_runme.1.d
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/d/bools_runme.1.d')
-rw-r--r--Examples/test-suite/d/bools_runme.1.d20
1 files changed, 20 insertions, 0 deletions
diff --git a/Examples/test-suite/d/bools_runme.1.d b/Examples/test-suite/d/bools_runme.1.d
new file mode 100644
index 000000000..f501b0762
--- /dev/null
+++ b/Examples/test-suite/d/bools_runme.1.d
@@ -0,0 +1,20 @@
+/// This is the bool runtime testcase. It checks that the C++ bool type works.
+module bools_runme;
+
+import bools.bools;
+
+void main() {
+ bool t = true;
+ bool f = false;
+
+ check_bo(f);
+ check_bo(t);
+}
+
+void check_bo(bool input) {
+ for (int i = 0; i < 1000; ++i) {
+ if (bo(input) != input) {
+ throw new Exception("Runtime test check_bo failed.");
+ }
+ }
+}