File: knobs.wl

package info (click to toggle)
wadc 3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 7,352 kB
  • sloc: java: 3,808; ansic: 1,950; xml: 135; makefile: 67; sh: 34
file content (19 lines) | stat: -rw-r--r-- 493 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#"standard.h"

main
{
  -- the first time a knob is evaluated, the value should
  -- match what is provided
  assert(eq(10, knob("foo", 0, 10, 10)))

  -- the second time it's evaluated, the value should be
  -- ignored and the previous value picked
  assert(eq(10, knob("foo", 0, 8, 10)))

  -- however, the value should be clamped at max...
  assert(eq(5, knob("foo", 0, 8, 5)))

  -- check clamping at the min
  assert(eq(2, knob("bar", 0, 2, 10)))
  assert(eq(5, knob("bar", 5, 2, 10)))
}