File: test.ya.exp

package info (click to toggle)
libdap 3.9.3-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 13,388 kB
  • ctags: 6,966
  • sloc: cpp: 32,601; ansic: 11,148; sh: 10,960; exp: 4,232; yacc: 1,694; makefile: 795; tcl: 509; perl: 138; xml: 80
file content (63 lines) | stat: -rw-r--r-- 2,278 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
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

# expect/tcl code to test the expression parser and scanner. This test checks
# to see that the expr parser correctly rejects arrays that are partially
# constrained. 6/11/2002 jhrg

global comp_output		# contains output from das-test_start
global verbose			# this and srcdir are set by runtest.exp
global srcdir

# The variable `test_file' is the name of the das input file for this test.

set test_name test.ya
set test_file test.d

# The variable test_equation is the equation to test.

set test_equation {"i,f,a" -b}

# The variable `test_out' is a string that contains the text that should be
# stored in comp_output by das-test_start. The two strings should match
# exactly.

set test_out "The complete DDS:
Dataset {
    Sequence {
        Int32 i;
        Int32 j;
        Sequence {
            Float32 f;
            Float32 g;
            Sequence {
                Byte a;
                Byte b;
            } baby;
        } child;
    } parent;
} testc;
The data:
Sequence {
    Int32 i;
    Sequence {
        Float32 f;
        Sequence {
            Byte a;
        } baby;
    } child;
} parent = { { 32, { { -54.4, { { 0 }, { 1 }, { 2 }, { 3 } } }, { -1.77, { { 4 }, { 5 }, { 6 }, { 7 } } }, { 98.93, { { 8 }, { 9 }, { 10 }, { 11 } } }, { 92.68, { { 12 }, { 13 }, { 14 }, { 15 } } } } }, { 1024, { { 99.48, { { 16 }, { 17 }, { 18 }, { 19 } } }, { 81.67, { { 20 }, { 21 }, { 22 }, { 23 } } }, { 10.59, { { 24 }, { 25 }, { 26 }, { 27 } } }, { 91.29, { { 28 }, { 29 }, { 30 }, { 31 } } } } }, { 32768, { { 45.2, { { 32 }, { 33 }, { 34 }, { 35 } } }, { -99.97, { { 36 }, { 37 }, { 38 }, { 39 } } }, { -86, { { 40 }, { 41 }, { 42 }, { 43 } } }, { -56.61, { { 44 }, { 45 }, { 46 }, { 47 } } } } }, { 1048576, { { -90.17, { { 48 }, { 49 }, { 50 }, { 51 } } }, { 99.38, { { 52 }, { 53 }, { 54 }, { 55 } } }, { 81.67, { { 56 }, { 57 }, { 58 }, { 59 } } }, { 10.59, { { 60 }, { 61 }, { 62 }, { 63 } } } } } };"

expr-test_start p ${srcdir}/${test_file} ${test_equation}

if [string match $test_out $comp_output] { # check comp_output
    pass "$test_name"
} else {
    fail "$test_name"
}

expr-test_start P ${srcdir}/${test_file} ${test_equation}

if [string match $test_out $comp_output] { # check comp_output
    pass "$test_name"
} else {
    fail "$test_name"
}