summaryrefslogtreecommitdiff
path: root/t/basic-tests.t
diff options
context:
space:
mode:
Diffstat (limited to 't/basic-tests.t')
-rw-r--r--t/basic-tests.t77
1 files changed, 77 insertions, 0 deletions
diff --git a/t/basic-tests.t b/t/basic-tests.t
new file mode 100644
index 0000000..3f8f7d4
--- /dev/null
+++ b/t/basic-tests.t
@@ -0,0 +1,77 @@
+use strict;
+use lib -e 't' ? 't' : 'test';
+use TestYAML tests => 4;
+
+filters {
+ yaml => [yaml => 'dumper'],
+ perl => [strict => eval => 'dumper'],
+};
+
+run_is yaml => 'perl';
+
+__END__
+=== A simple map
++++ yaml
+---
+one: foo
+two: bar
+three: baz
++++ perl
++{qw(one foo two bar three baz)}
+
+
+=== Common String Types
++++ yaml
+---
+one: simple string
+two: 42
+three: '1 Single Quoted String'
+four: "YAML's Double Quoted String"
+five: |
+ A block
+ with several
+ lines.
+six: |-
+ A "chomped" block
+seven: >
+ A
+ folded
+ string
++++ perl
+{
+ one => "simple string",
+ two => '42',
+ three => "1 Single Quoted String",
+ four => "YAML's Double Quoted String",
+ five => "A block\n with several\n lines.\n",
+ six => 'A "chomped" block',
+ seven => "A folded\n string\n",
+}
+
+
+=== Multiple documents
++++ yaml
+---
+foo: bar
+---
+bar: two
++++ perl
++{qw(foo bar)}, {qw(bar two)};
+
+
+=== Comments
++++ yaml
+# Leading Comment
+---
+# Preceding Comment
+foo: bar
+# Two
+# Comments
+---
+ # Indented comment
+bar: two
+bee: three
+# Intermediate comment
+bore: four
++++ perl
++{qw(foo bar)}, {qw(bar two bee three bore four)}