Eskil

Check-in [3eb6a91852]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Moved testsuite into tests directory.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3eb6a918520a56611e71705ca0bb7cdc8696a8b8
User & Date: peter 2004-05-03 17:34:44.000
Context
2004-05-03
17:35
Moved large block warning to insertMatchingBlocks. Flag with a "!". check-in: ce427b3c7b user: peter tags: trunk
17:34
Moved testsuite into tests directory. check-in: 3eb6a91852 user: peter tags: trunk
16:51
Release 2.0.2. Added changes section. check-in: 2059053834 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Makefile.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Testing
#----------------------------------------------------------------

check:
	@nagelfar.kit eskil.tcl

test:
	@./testsuite.tcl

#----------------------------------------------------------------
# Packaging/Releasing
#----------------------------------------------------------------

wrap:
	sdx wrap eskil.kit







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Testing
#----------------------------------------------------------------

check:
	@nagelfar.kit eskil.tcl

test:
	@./tests/all.tcl

#----------------------------------------------------------------
# Packaging/Releasing
#----------------------------------------------------------------

wrap:
	sdx wrap eskil.kit
Added tests/all.tcl.










































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
#!/bin/sh
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

set testScript [file normalize [file join [pwd] [info script]]]
set testDir    [file dirname $testScript]

lappend auto_path eskil.vfs/lib

package require tcltest 2.2
namespace import tcltest::*
tcltest::configure -verbose "body error"
#testConstraint knownbug 1
#tcltest::configure -match eskil-1.*

package require Tk
wm withdraw .

set ::eskil_testsuite 1

set instrument 1
if {$instrument} {
    puts "Instrumenting"
    exec ./instrument.tcl compareBlocks
    source eskili.tcl
} else {
    source eskil.tcl
}
puts "Running Tests"

foreach test [glob -nocomplain $testDir/*.test] {
    source $test
}

if {$instrument} {
    puts "Checking instrumenting result"
    set ch [open _instrument_result w]
    puts $ch [join [lsort -integer [array names ::_instrument]] \n]
    close $ch
    set ch [open {|diff _instrument_lines _instrument_result}]
    while {[gets $ch line] >= 0} {
        if {[regexp {<|>} $line]} {
            puts $line
        }
    }
    catch {close $ch}
    #file delete _instrument_lines _instrument_result
    #file delete eskili.tcl
}
exit
Added tests/blocks.test.




















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
64
65
66
67
68
69
70
71
72
73
74
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------

test blocks-1.1 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list "Apa 2" "Bepa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {c c c}

test blocks-1.2 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c}

test blocks-1.3 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list                  "Cepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d d c a}

test blocks-1.4 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C}

test blocks-1.5 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C d}

test blocks-1.6 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Apa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c d}

# A big block
test blocks-1.7 {
    Change-block parsing
} -body {
    set b1 {a}
    set b2 {}
    for {set t 0} {$t < 40} {incr t} {
        lappend b1 $t
        lappend b2 $t
    }
    lappend b2 a
    compareBlocks $b1 $b2
} -result {d c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c a}

# This is designed to be complex enough to trigger the innermost loop
test blocks-1.8 {
    Change-block parsing, complex case
} -body {
    set b1 [list a 4              10    0 14 6 0 4 13 16 11]
    set b2 [list   3 1 7 12 11 17 10 15 0             16 a]
    compareBlocks $b1 $b2
} -result  [list d C a a a  a  a  c  a  c d  d d d d  c  C]
Deleted testsuite.tcl.
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/sh
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

lappend auto_path eskil.vfs/lib

package require tcltest 2.2
namespace import tcltest::*
tcltest::configure -verbose "body error"
#testConstraint knownbug 1
#tcltest::configure -match eskil-1.*

package require Tk
wm withdraw .

set ::eskil_testsuite 1

set instrument 0
if {$instrument} {
    exec ./instrument.tcl compareBlocks
    source eskili.tcl
} else {
    source eskil.tcl
}

test eskil-2.1 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list "Apa 2" "Bepa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {c c c}

test eskil-2.2 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c}

test eskil-2.3 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list                  "Cepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d d c a}

test eskil-2.4 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C}

test eskil-2.5 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1" "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Gurka"]
    compareBlocks $b1 $b2
} -result {d c C d}

test eskil-2.6 {
    Change-block parsing
} -body {
    set b1 [list "Apa 1" "Bepa 1"         "Cepa 1" "Depa 1"]
    set b2 [list         "Bepa 2" "Apa 2" "Cepa 2"]
    compareBlocks $b1 $b2
} -result {d c a c d}

if {$instrument} {
    set ch [open _instrument_result w]
    puts $ch [join [lsort -integer [array names ::_instrument]] \n]
    close $ch
    set ch [open {|diff _instrument_lines _instrument_result}]
    while {[gets $ch line] >= 0} {
        if {[regexp {<|>} $line]} {
            puts $line
        }
    }
    catch {close $ch}
    #file delete _instrument_lines _instrument_result
    #file delete eskili.tcl
}
exit
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<