~jason2605/dictu/trunk

« back to all changes in this revision

Viewing changes to tests/operators/plus.du

  • Committer: GitHub
  • Author(s): Jason_000
  • Date: 2020-11-30 23:26:50 UTC
  • mfrom: (30.1.263)
  • Revision ID: git-v1:4923d4401e1b291604b053289ab9f435b10ee14d
Tags: v0.14.0
Merge pull request #340 from dictu-lang/develop

Release 0.14.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
assert(x + 1 == 11);
10
10
assert(x + x == 20);
11
11
assert(1 + x == 11);
12
 
assert(10 + x + 10 == 30);
 
 
b'\\ No newline at end of file'
 
12
assert(10 + x + 10 == 30);
 
13
 
 
14
// Test function call (useful for constant folding)
 
15
def test() {
 
16
    return 1 + 2 + 3;
 
17
}
 
18
 
 
19
assert(test() + 2 + test() == 14);
 
20
 
 
21
def calculate(a, b, c) {
 
22
    return a + b + c;
 
23
}
 
24
 
 
25
assert(calculate(1, 2, 3) + calculate(2, 3, 4) == 15);
 
26
 
 
27
// Test super
 
28
class Test {
 
29
    test() {
 
30
        return 10;
 
31
    }
 
32
}
 
33
 
 
34
class AnotherClass < Test {
 
35
    test() {
 
36
        return super.test() + 10;
 
37
    }
 
38
}
 
39
 
 
40
assert(AnotherClass().test() == 20);
 
 
b'\\ No newline at end of file'