Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 24 lines (15 sloc) 0.789 kB
b0db2e4 @timburks Instances of NuZero now are considered false.
authored
1 ;; test_truth.nu
2 ;; tests for Nu representations of truth and falseness.
3 ;;
29db4cd @timburks Company name changed.
authored
4 ;; Copyright (c) 2007 Tim Burks, Radtastical Inc.
b0db2e4 @timburks Instances of NuZero now are considered false.
authored
5
6 (class TestTruth is NuTestCase
7
045f219 @timburks Replace "cmethod" and "imethod" with "+" and "-".
authored
8 (- (id) testTrue is
9 (assert_equal "true" (if 1 (then "true") (else "false")))
10 (assert_equal "true" (if YES (then "true") (else "false")))
11 (assert_equal "true" (if (list 1 2 3) (then "true") (else "false")))
12 (assert_equal "true" (if "zero" (then "true") (else "false")))
13 (assert_equal "true" (if "false" (then "true") (else "false"))))
b0db2e4 @timburks Instances of NuZero now are considered false.
authored
14
045f219 @timburks Replace "cmethod" and "imethod" with "+" and "-".
authored
15 (- (id) testFalse is
16 (assert_equal "false" (if 0 (then "true") (else "false")))
17 (assert_equal "false" (if NO (then "true") (else "false")))
18 (assert_equal "false" (if nil (then "true") (else "false")))))
19
b0db2e4 @timburks Instances of NuZero now are considered false.
authored
20
21
22
23
Something went wrong with that request. Please try again.