82 lines
1.6 KiB
Plaintext
82 lines
1.6 KiB
Plaintext
|
|
# Check basic SECONDO commands
|
||
|
|
#
|
||
|
|
# Oct 2006, M. Spiekermann
|
||
|
|
#
|
||
|
|
|
||
|
|
delete database prtest;
|
||
|
|
|
||
|
|
#setup prtest
|
||
|
|
|
||
|
|
# if a command between the SETUP directive and the first
|
||
|
|
# TESTCASE directive fails, then the whole test has failed
|
||
|
|
# and we immediately skip to the teardown
|
||
|
|
# (the whole test does not make sense anymore if the
|
||
|
|
# SETUP has failed)
|
||
|
|
|
||
|
|
create database prtest;
|
||
|
|
|
||
|
|
open database prtest;
|
||
|
|
|
||
|
|
let p1 = [ const xpoint value (0 0) ];
|
||
|
|
let p2 = [ const xpoint value (1 1) ];
|
||
|
|
let p3 = [ const xpoint value (4 4) ];
|
||
|
|
let p4 = [ const xpoint value (0 0) ];
|
||
|
|
|
||
|
|
let r1 = [ const xrectangle value (0 2 0 2) ];
|
||
|
|
let r2 = [ const xrectangle value (1 2 1 2) ];
|
||
|
|
let r3 = [ const xrectangle value (3 5 3 5) ];
|
||
|
|
let r4 = [ const xrectangle value (1 2 1 2) ];
|
||
|
|
|
||
|
|
#testcase list algebras
|
||
|
|
#yields success
|
||
|
|
list algebra PointRectangleAlgebra;
|
||
|
|
|
||
|
|
#testcase out1;
|
||
|
|
#yields (xpoint (0 0))
|
||
|
|
query p1;
|
||
|
|
|
||
|
|
#testcase out2;
|
||
|
|
#yields (xrectangle (0 2 0 2))
|
||
|
|
query r1;
|
||
|
|
|
||
|
|
#testcase in1
|
||
|
|
#yields error
|
||
|
|
let p5 = [ const xpoint value (0 0 0) ];
|
||
|
|
|
||
|
|
#testcase in2
|
||
|
|
#yields error
|
||
|
|
let r5 = [ const xrectangle value (1 1 2 1 2) ];
|
||
|
|
|
||
|
|
|
||
|
|
#testcase inside1;
|
||
|
|
#yields (bool TRUE)
|
||
|
|
query p2 inside r1;
|
||
|
|
|
||
|
|
#testcase inside2;
|
||
|
|
#yields (bool FALSE)
|
||
|
|
query p4 inside r3;
|
||
|
|
|
||
|
|
#testcase inside3;
|
||
|
|
#yields (bool TRUE)
|
||
|
|
query r2 inside r1;
|
||
|
|
|
||
|
|
#testcase inside4;
|
||
|
|
#yields (bool FALSE)
|
||
|
|
query r2 inside r3;
|
||
|
|
|
||
|
|
#testcase intersects1;
|
||
|
|
#yields (bool TRUE)
|
||
|
|
query r1 intersects r2;
|
||
|
|
|
||
|
|
#testcase intersects2;
|
||
|
|
#yields (bool FALSE)
|
||
|
|
query r1 intersects r3;
|
||
|
|
|
||
|
|
# the TEARDOWN directive is followed by commands which
|
||
|
|
# should be executed after the execution of all TESTCASES
|
||
|
|
#teardown
|
||
|
|
|
||
|
|
close database;
|
||
|
|
delete database prtest;
|
||
|
|
|