YAML: add simple tests for >yaml and >yaml

db4
Jon Harper 2014-02-02 13:24:21 +01:00 committed by John Benediktsson
parent 5fe3ff9c52
commit 73642b173f
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
! Copyright (C) 2014 Jon Harper.
! See http://factorcode.org/license.txt for BSD license.
USING: literals tools.test yaml ;
IN: yaml.tests
! TODO real conformance tests here
CONSTANT: test-string """--- # Favorite movies
- Casablanca
- North by Northwest
- The Man Who Wasn't There
- last:
- foo
- bar
- baz
"""
CONSTANT: test-obj {
"Casablanca"
"North by Northwest"
"The Man Who Wasn't There"
H{ { "last" { "foo" "bar" "baz" } } }
}
CONSTANT: test-represented-string """--- !!seq
- !!str Casablanca
- !!str North by Northwest
- !!str The Man Who Wasn't There
- !!map
!!str last: !!seq
- !!str foo
- !!str bar
- !!str baz
...
"""
${ test-obj } [ $ test-string yaml> ] unit-test
${ test-represented-string } [ $ test-obj >yaml ] unit-test
${ test-represented-string } [ $ test-represented-string yaml> >yaml ] unit-test