From 26442cdbd03884072333b06a649f3efe1258fbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Ljunglo=CC=88f?= Date: Fri, 12 Jul 2019 11:05:40 +0200 Subject: [PATCH] unittest: example test file --- unittest/unittest-example.gftest | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 unittest/unittest-example.gftest diff --git a/unittest/unittest-example.gftest b/unittest/unittest-example.gftest new file mode 100644 index 000000000..7897a79e6 --- /dev/null +++ b/unittest/unittest-example.gftest @@ -0,0 +1,41 @@ +# This file consists of some example unittests +# Tests are separated by blank lines +# Comment lines start with "#" or "--" + +# The recommendation is to put unittest files +# in the directory 'src/(language)/unittest' +# and use the file suffix '.gftest' + +# Basic usage: a sentence and its translation +LangEng: I sleep in the house +LangSwe: jag sover i huset + +# Comparing a sentence and a parse tree +LangEng: the house is big +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN house_N)) (UseComp (CompAP (PositA big_A)))))) NoVoc + +-- Several translations of a sentence +LangEng: I sleep in the house +LangSwe: jag sover i huset +LangGer: ich schlafe im Haus + +-- Ambiguous sentences (the fish can be singular or plural) +-- The test is correct if some translations match +-- (i.e., if the set of parse trees overlap) +LangEng: the cat eats the fish +LangSwe: katten äter fisken + +# If we only specify one sentence, the script only checks if it's possible to parse +LangEng: the cat in Paris sleeps + +# This test should fail, becuase they are not translations of each other +LangEng: the house is big +LangSwe: jag sover i huset + +# Here are some GF parsing errors +# This sentence cannot be parsed: +LangEng: this is not parseable +# This sentence is not complete: +LangEng: I sleep in +# This is not an abstract syntax tree: +Lang: THIS IS NOT A TREE