File: Test13

package info (click to toggle)
omake 0.10.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 14,076 kB
  • sloc: ml: 49,729; ansic: 5,163; makefile: 688; sh: 110
file content (16 lines) | stat: -rw-r--r-- 270 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
o. =
   val = 0
   incr(x) =
      val = $(add $(val), $(x))
      export val

printvln($o)
o.incr(2)
o.incr(3)
printvln($o)

if $(not $(eq $(o.val), 5))
   eprintln($"Object hoisting test failed!")
   eprintln($"Expected: 5")
   eprintln($"Actual: $(o.val)")
   exit 1