Check-in [00ccb10f83]

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

Overview
Comment:Add more FDDD tests, clean up whitespace in tests, and fix bugs exposed in testing.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:00ccb10f83572ea076837718c6c3d403717555ab
User & Date: kbk 2014-08-03 00:21:42
Context
2014-08-03
01:37
Add more FDDD tests, clean up whitespace in tests, and fix bugs exposed in testing. check-in: e546ebb465 user: kbk tags: trunk
00:21
Add more FDDD tests, clean up whitespace in tests, and fix bugs exposed in testing. check-in: 00ccb10f83 user: kbk tags: trunk
00:18
Add more FDDD tests, clean up whitespace in tests, and fix bugs exposed in testing. check-in: c976bf220b user: kbk tags: trunk
Changes

Changes to library/tclfddd.tcl.

957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
		"relation \"$name\" is already defined in this database"
	}
	set havecol {}
	foreach col $args {
	    my columnMustExist $col
	    if {[dict exists $havecol $col]} {
		return -code error -errorcode [list FDDD DuplicateColumn $col] \
		    "column $col is duplicated in the column list"
	    }
	    dict set $havecol $col {}
	}
	dict set m_relcolumns $name $args
	{*}[my set $name {}]
	return $name
    }

    # Method: relationMustExist







|

|







957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
		"relation \"$name\" is already defined in this database"
	}
	set havecol {}
	foreach col $args {
	    my columnMustExist $col
	    if {[dict exists $havecol $col]} {
		return -code error -errorcode [list FDDD DuplicateColumn $col] \
		    "column \"$col\" is duplicated in the column list"
	    }
	    dict set havecol $col {}
	}
	dict set m_relcolumns $name $args
	{*}[my set $name {}]
	return $name
    }

    # Method: relationMustExist

Changes to tests/fddd.test.

239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256











257
258
259
260
261
262
263
...
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
        db relation isParentOf parent child
        lsort [db columns isParentOf]
    }
    -cleanup {db destroy}
    -result {child parent}
}

test fddd-4.3 {relation construction - duplicate name} {*}{
    -setup makeDB
    -body {
        db relation isParentOf parent child
        list [catch {
            db relation isParentOf parent child
        } result] $result $::errorCode
    }
    -cleanup {db destroy}
    -result {1 {relation "isParentOf" is already defined in this database} {FDDD RelationAlreadyDefined isParentOf}}
}












proc makeDB {} {
    bdd::fddd::database create ::db\
        [bdd::fddd::interleave \
             [bdd::fddd::domain parent 8] \
             [bdd::fddd::domain child 8] \
             [bdd::fddd::domain xyz 8]]
................................................................................
    -body {
        list [catch {
            db project everything isParentOf
        } result] $result $::errorCode
    }
    -cleanup {db destroy}
    -result {1 {column(s) missing from source relation: bit xyz} {FDDD ProjectColumnsMissing {bit xyz}}}
}

test fddd-15.4 {project} {*}{
    -setup makeDB
    -body {
        eval [db project troll isParentOf]
        set r {}
        db enumerate d troll {







|










>
>
>
>
>
>
>
>
>
>
>







 







|







239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
...
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
        db relation isParentOf parent child
        lsort [db columns isParentOf]
    }
    -cleanup {db destroy}
    -result {child parent}
}

test fddd-4.3 {relation construction - duplicate relation} {*}{
    -setup makeDB
    -body {
        db relation isParentOf parent child
        list [catch {
            db relation isParentOf parent child
        } result] $result $::errorCode
    }
    -cleanup {db destroy}
    -result {1 {relation "isParentOf" is already defined in this database} {FDDD RelationAlreadyDefined isParentOf}}
}

test fddd-4.4 {relation construction - duplicate column} {*}{
    -setup makeDB
    -body {
        list [catch {
            db relation isParentOf parent child parent
        } result] $result $::errorCode
    }
    -cleanup {db destroy}
    -result {1 {column "parent" is duplicated in the column list} {FDDD DuplicateColumn parent}}
}

proc makeDB {} {
    bdd::fddd::database create ::db\
        [bdd::fddd::interleave \
             [bdd::fddd::domain parent 8] \
             [bdd::fddd::domain child 8] \
             [bdd::fddd::domain xyz 8]]
................................................................................
    -body {
        list [catch {
            db project everything isParentOf
        } result] $result $::errorCode
    }
    -cleanup {db destroy}
    -result {1 {column(s) missing from source relation: bit xyz} {FDDD ProjectColumnsMissing {bit xyz}}}
} 

test fddd-15.4 {project} {*}{
    -setup makeDB
    -body {
        eval [db project troll isParentOf]
        set r {}
        db enumerate d troll {