PageRenderTime 22ms CodeModel.GetById 19ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/test/booleans.coffee

http://github.com/jashkenas/coffee-script
CoffeeScript | 21 lines | 14 code | 4 blank | 3 comment | 0 complexity | afc9207b4147d789b94687d770cfe72e MD5 | raw file
 1# Boolean Literals
 2# ----------------
 3
 4# TODO: add method invocation tests: true.toString() is "true"
 5
 6test "#764 Booleans should be indexable", ->
 7  toString = Boolean::toString
 8
 9  eq toString, true['toString']
10  eq toString, false['toString']
11  eq toString, yes['toString']
12  eq toString, no['toString']
13  eq toString, on['toString']
14  eq toString, off['toString']
15
16  eq toString, true.toString
17  eq toString, false.toString
18  eq toString, yes.toString
19  eq toString, no.toString
20  eq toString, on.toString
21  eq toString, off.toString