From 73642b173f6fe89a7133ddeb98c912f2ccee86aa Mon Sep 17 00:00:00 2001 From: Jon Harper Date: Sun, 2 Feb 2014 13:24:21 +0100 Subject: [PATCH] YAML: add simple tests for >yaml and >yaml --- extra/yaml/yaml-tests.factor | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 extra/yaml/yaml-tests.factor diff --git a/extra/yaml/yaml-tests.factor b/extra/yaml/yaml-tests.factor new file mode 100644 index 0000000000..b203c86b1f --- /dev/null +++ b/extra/yaml/yaml-tests.factor @@ -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