forked from GitHub/gf-core
Add unit test for literals (fails)
This commit is contained in:
@@ -104,11 +104,17 @@ Max memory: 328.20 MB
|
||||
- size: 3.01 MB Phrasebook.lpgf
|
||||
Max memory: 1.33 GB
|
||||
|
||||
**Baseline LPGF String**
|
||||
**Baseline LPGF String instead of Text**
|
||||
- compile: 12.124689s
|
||||
- size: 3.01 MB Phrasebook.lpgf
|
||||
Max memory: 1.34 GB
|
||||
|
||||
**Baseline LPGF with impossible pruning**
|
||||
- compile: 7.406503s
|
||||
- size: 3.01 MB Phrasebook.lpgf
|
||||
Max memory: 1.13 GB
|
||||
|
||||
|
||||
**B -extractStrings**
|
||||
- compile: 13.822735s
|
||||
- size: 5.78 MB Phrasebook.lpgf
|
||||
|
||||
@@ -21,7 +21,7 @@ done < $TREES
|
||||
|
||||
echo "Writing $TREEBANK"
|
||||
: > $TREEBANK
|
||||
gf --crun $ABSNAME.pgf < "$SCRIPT" > /dev/null
|
||||
gf --crun "$ABSNAME.pgf" < "$SCRIPT" > /dev/null
|
||||
|
||||
echo "Removing $SCRIPT"
|
||||
rm "$SCRIPT"
|
||||
|
||||
7
testsuite/lpgf/unittests/Literals.gf
Normal file
7
testsuite/lpgf/unittests/Literals.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
abstract Literals = {
|
||||
cat S ;
|
||||
fun
|
||||
mkString : String -> S ;
|
||||
mkInt : Int -> S ;
|
||||
mkFloat : Float -> S ;
|
||||
}
|
||||
9
testsuite/lpgf/unittests/Literals.treebank
Normal file
9
testsuite/lpgf/unittests/Literals.treebank
Normal file
@@ -0,0 +1,9 @@
|
||||
Literals: mkString "hello"
|
||||
LiteralsCnc: hello
|
||||
|
||||
Literals: mkInt 123
|
||||
LiteralsCnc: 123
|
||||
|
||||
Literals: mkFloat 30.809000
|
||||
LiteralsCnc: 30.809000
|
||||
|
||||
3
testsuite/lpgf/unittests/Literals.trees
Normal file
3
testsuite/lpgf/unittests/Literals.trees
Normal file
@@ -0,0 +1,3 @@
|
||||
mkString "hello"
|
||||
mkInt 123
|
||||
mkFloat 30.809
|
||||
7
testsuite/lpgf/unittests/LiteralsCnc.gf
Normal file
7
testsuite/lpgf/unittests/LiteralsCnc.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
concrete LiteralsCnc of Literals = open Prelude in {
|
||||
lincat S = SS ;
|
||||
lin
|
||||
mkString s = s ;
|
||||
mkInt s = s ;
|
||||
mkFloat s = s ;
|
||||
}
|
||||
Reference in New Issue
Block a user