Wiki

root/cobra/trunk/Tests/110-basics-two/120-primitive-type-members.cobra

Revision 1953, 0.6 KB (checked in by Chuck.Esterbrook, 3 years ago)

Update tests to be robust against variations in culture which would normally change .toString results.
ticket:153
credit:jonathandavid

  • Property svn:eol-style set to native
Line 
1class Test
2
3    def main is shared
4        c = c'A'
5        assert c.isUpper
6        assert not c.isLower
7        c = c'a'
8        assert not c.isUpper
9        assert c.isLower
10        c = c.toUpper
11        assert c.isUpper
12        assert not c.isLower
13
14        assert char.isLetter('aoeu', 2)
15
16        d = 5.24
17        assert d.negate == -5.24
18        assert d.round == 5.0
19        assert d.round(1) == 5.2
20
21        d = decimal.parse('5.0', System.Globalization.CultureInfo.invariantCulture)
22        assert d == 5.0
23        d = 3.0
24        assert d.pow(4.5).round(3) == 140.296
25        d = 4.5
26        assert d.sqrt.round(3) == 2.121
27
28        f = 3.5f
29        assert f.sin.round(2) == -0.35f
30
31        assert 5.getType.name.toLower.startsWith('int')
32
33        assert 3.compareTo(5) < 0
Note: See TracBrowser for help on using the browser.