File: errors1.bsh

package info (click to toggle)
bsh 1.1alpha5-1
  • links: PTS
  • area: contrib
  • in suites: woody
  • size: 2,336 kB
  • ctags: 2,083
  • sloc: java: 16,095; makefile: 134; sh: 51
file content (26 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (13)
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
#!/bin/java bsh.Interpreter

source("TestHarness.bsh");

print("undefined variable void assignment:");
assert( isEvalError("a = booga;") );

print("Undefined static method access:");
assert( isEvalError("java.lang.System.booga();") );

print("Another undefined static method access:");
assert( isEvalError("System.booga();") );

print("undefined static field access:");
assert( isEvalError("java.lang.System.booga;") );

print("undefined static field access with assign:");
assert( isEvalError("b = java.lang.System.booga;") );

print("Another undefined static field access:");
assert( isEvalError("System.booga;") );

// should be ok
assert( ! isEvalError("System.out;") );

complete();