Files
secondo/Algebras/Chess/ExampleDataScripts/chess1_movingpoints.test
2026-01-23 17:03:45 +08:00

88 lines
3.0 KiB
Plaintext

#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#SECONDO is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# a test for the chess algebra
# run with : TestRunner -i chess.test
# clean up what may be left over from e.g. a segfault
delete database chessmpdb;
#setup
create database chessmpdb;
open database chessmpdb;
let chess1 = [const chessgame value ((
("Event" "Test der Chessgame Klasse")
("Site" "...")
("Date" "2006.12.08")
("White" "Mirko D.")
("Black" "somebody else")
("WhiteElo" "100")
("BlackElo" "2500")
("EventDate" "2006.12.07"))
(
("Pawn" "none" "c" 2 "c" 4 FALSE "c4")
("pawn" "none" "c" 7 "c" 5 FALSE "c5")
("Pawn" "none" "d" 2 "d" 3 FALSE "d3")
("pawn" "none" "d" 7 "d" 6 FALSE "d6")
("Knight" "none" "b" 1 "c" 3 FALSE "Nc3")
("bishop" "none" "c" 8 "f" 5 FALSE "Bf5")
("Pawn" "none" "e" 2 "e" 4 FALSE "e4")
("bishop" "Pawn" "f" 5 "e" 4 FALSE "Bxe4")
("Knight" "bishop" "c" 3 "e" 4 FALSE "Nxe4")
("pawn" "none" "g" 7 "g" 6 FALSE "g6")
("Bishop" "none" "c" 1 "e" 3 FALSE "Be3")
("pawn" "none" "h" 7 "h" 5 FALSE "h5")
("Queen" "none" "d" 1 "d" 2 FALSE "Qd2")
("queen" "none" "d" 8 "d" 7 FALSE "Qd7")
("King" "none" "e" 1 "c" 1 FALSE "O-O-O")
("knight" "none" "b" 8 "a" 6 FALSE "Na6")
("Knight" "none" "g" 1 "h" 3 FALSE "Nh3")
("pawn" "none" "b" 7 "b" 6 FALSE "b6")
("Knight" "none" "e" 4 "g" 5 FALSE "Neg5")
("queen" "Knight" "d" 7 "h" 3 FALSE "Qxh3")
("Pawn" "queen" "g" 2 "h" 3 FALSE "gxh3")
("pawn" "none" "h" 5 "h" 4 FALSE "h4")
("Bishop" "pawn" "e" 3 "c" 5 FALSE "Bxc5")
("pawn" "none" "b" 6 "b" 5 FALSE "b5")
("Bishop" "pawn" "c" 5 "d" 6 FALSE "Bxd6")
("pawn" "none" "b" 5 "b" 4 FALSE "b4")
("Pawn" "none" "c" 4 "c" 5 FALSE "c5")
("pawn" "none" "b" 4 "b" 3 FALSE "b3")
("Pawn" "none" "c" 5 "c" 6 FALSE "c6")
("pawn" "none" "f" 7 "f" 6 FALSE "f6")
("Pawn" "none" "c" 6 "c" 7 FALSE "c7")
("pawn" "none" "f" 6 "f" 5 FALSE "f5")
("Pawn" "none" "c" 7 "c" 8 TRUE "c8=Q+")
))];
#######################################################################
# test for movingpoints operator
#######################################################################
#testcase test_movingpoints_simple_but_complete
#yields @chess1_movingpoints.testinp
query chess1 movingpoints consume;
# the TEARDOWN directive is followed by commands which
# should be executed after the execution of all TESTCASES
#teardown
close database;
delete database chessmpdb;