PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/t/basic/02preincdec.t

http://github.com/NotFound/winxed
text | 23 lines | 16 code | 7 blank | 0 comment | 0 complexity | 1a3d1ec8a4123b8a95bb958039884d92 MD5 | raw file
 1#! winxed
 2
 3// Basic tests for (prefix) int ++ and -- operator
 4
 5using extern Test.More plan, is;
 6
 7function main()
 8{
 9    plan (4);
10
11    int a = 69;
12    int c;
13
14    c = ++a;
15    is (c, 70, 'pre ++ result');
16    is (a, 70, 'pre ++ side effect');
17
18    c = --a;
19    is (c, 69, 'pre -- result');
20    is (a, 69, 'pre -- side effect');
21}
22
23// End