File: stdlib.liq

package info (click to toggle)
liquidsoap 2.1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,924 kB
  • sloc: ml: 73,577; javascript: 24,836; sh: 3,440; makefile: 764; xml: 114; ansic: 96; lisp: 62; python: 35; perl: 8; ruby: 8
file content (26 lines) | stat: -rwxr-xr-x 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!../../src/liquidsoap ../../libs/stdlib.liq

%include "test.liq"

success = ref(true)

def t(x, y)
  if x != y then
    print("Failure: got #{x} instead of #{y}")
    success := false
  end
end

def f() =
  t(getenv("BLAXXX"),"")
  t(file.is_directory("/"), true)
  t(file.is_directory("~"), true)
  t(file.is_directory("XXX"), false)

  t(liquidsoap.version.at_least("2.0.0"), true)
  t(liquidsoap.version.at_least("666.0.0"), false)

  if !success then test.pass() else test.fail() end
end

test.check(f)