Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: amalgamated
Fetching contributors…

Cannot retrieve contributors at this time

24 lines (15 sloc) 0.789 kb
;; test_truth.nu
;; tests for Nu representations of truth and falseness.
;;
;; Copyright (c) 2007 Tim Burks, Radtastical Inc.
(class TestTruth is NuTestCase
(- (id) testTrue is
(assert_equal "true" (if 1 (then "true") (else "false")))
(assert_equal "true" (if YES (then "true") (else "false")))
(assert_equal "true" (if (list 1 2 3) (then "true") (else "false")))
(assert_equal "true" (if "zero" (then "true") (else "false")))
(assert_equal "true" (if "false" (then "true") (else "false"))))
(- (id) testFalse is
(assert_equal "false" (if 0 (then "true") (else "false")))
(assert_equal "false" (if NO (then "true") (else "false")))
(assert_equal "false" (if nil (then "true") (else "false")))))
Jump to Line
Something went wrong with that request. Please try again.