26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
if (mkdir_ret != 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("failed", -1));
return(TCL_ERROR);
};
return(TCL_OK);
}
puts [test 1]
puts [test1 1]
puts [test3 1]
puts [::bob::test1 1]
puts [add [test 1] 1]
catch {
puts [mkdir "/"]
} err
if {$err != "failed"} {
error "\[mkdir\] did not return the expected error"
}
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
59
60
61
62
63
|
if (mkdir_ret != 0) {
Tcl_SetObjResult(interp, Tcl_NewStringObj("failed", -1));
return(TCL_ERROR);
};
return(TCL_OK);
}
# Return error on NULL
tcc4tcl::cproc test4 {int v} char* {
if (v == 1) {
return("ok");
}
return(NULL);
}
puts [test 1]
puts [test1 1]
puts [test3 1]
puts [::bob::test1 1]
puts [add [test 1] 1]
puts [test4 1]
catch {
puts [mkdir "/"]
} err
if {$err != "failed"} {
error "\[mkdir\] did not return the expected error"
}
catch {
set v 0
puts [test4 0]
set v 1
} err
if {$err != "" || $v == 1} {
error "\[test4\] did not return the expected error"
}
|