File: testsuite.in

package info (click to toggle)
pike8.0 8.0.702-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 79,608 kB
  • sloc: ansic: 266,508; xml: 186,324; makefile: 3,537; sh: 1,731; cpp: 1,328; lisp: 655; awk: 441; asm: 242; objc: 240; pascal: 157; perl: 34; sed: 34
file content (58 lines) | stat: -rw-r--r-- 1,552 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
START_MARKER
dnl add_include_path
dnl add_module_path
dnl add_program_path

test_eq(basename("/a/b"),"b")
test_eq(basename("/a/"),"")
test_eq(basename("/a"),"a")
test_eq(basename("/"),"")
test_eq(basename("a/b"),"b")
test_eq(basename("a/"),"")
test_eq(basename("a"),"a")
test_eq(basename(""),"")

test_eq(dirname("/a/b/"),"/a/b")
test_eq(dirname("/a/b"),"/a")
test_eq(dirname("/a/"),"/a")
test_eq(dirname("/a"),"/")
test_eq(dirname("/"),"/")
test_eq(dirname(""),"")
test_eq(dirname("a/b/"),"a/b")
test_eq(dirname("a/b"),"a")
test_eq(dirname("a/"),"a")
test_eq(dirname("a"),"")

test_eq( catch(error("x"))[0], "x" )
test_eq( catch(error("X"))[1][0]->fun, master()->_main )
test_eq( catch(error("%x", 10))[0], "a" )
test_eval_error( error("%s", 0) )

test_true( true )
test_false( false )
test_do( bool x=true; )
test_do( bool x=false; )

dnl is_absolute_path
dnl normalize_path
dnl putenv
dnl remove_include_path
dnl remove_module_path
dnl remove_program_path

dnl master()->set_inhibit_compile_errors
test_any([[
  master()->set_inhibit_compile_errors(lambda(){});
  mixed res = catch{compile_string("dfasfqw123");};
  master()->set_inhibit_compile_errors(0);
  return arrayp(res)||objectp(res);
]], 1)

// - pike -e
test_false( Process.system(RUNPIKE + " -e \"return 0;\"") )
test_true( Process.system(RUNPIKE + " -e \"return 1;\"") )
test_true( Process.system(RUNPIKE + " -e \"return NOT(0);\"") )
test_true( Process.system(RUNPIKE + " -e \"return CHAR(A)==65;\"") )
test_eq( Process.popen(RUNPIKE + " -e \"return (string)7;\""), "7\n" )

END_MARKER