File: 18_tap.t

package info (click to toggle)
libyaml-tiny-perl 1.51-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 380 kB
  • sloc: perl: 2,482; makefile: 45
file content (80 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/perl

# Testing relating to functionality in the Test Anything Protocol

use strict;
BEGIN {
	$|  = 1;
	$^W = 1;
}

use File::Spec::Functions ':ALL';
use t::lib::Test;
use Test::More tests(5, 0, 0);
use YAML::Tiny ();





#####################################################################
# TAP Tests

# Make sure we support x-foo keys
yaml_ok(
	"---\nx-foo: 1\n",
	[ { 'x-foo' => 1 } ],
	'x-foo key',
);

# Document ending (hash)
yaml_ok(
	  "---\n"
	. "  foo: bar\n"
	. "...\n",
	[ { foo => "bar" } ],
	'document_end_hash',
	noyamlpm   => 1,
	nosyck     => 1,
	noyamlperl => 1,
);

# Document ending (array)
yaml_ok(
	  "---\n"
	. "- foo\n"
	. "...\n",
	[ [ 'foo' ] ],
	'document_end_array',
	noyamlpm => 1,
	noyamlperl => 1,
);

# Multiple documents (simple)
yaml_ok(
	  "---\n"
	. "- foo\n"
	. "...\n"
	. "---\n"
	. "- foo\n"
	. "...\n",
	[ [ 'foo' ], [ 'foo' ] ],
	'multi_document_simple',
	noyamlpm   => 1,
	noyamlperl => 1,
);

# Multiple documents (whitespace-separated)
yaml_ok(
	  "---\n"
	. "- foo\n"
	. "...\n"
	. "\n"
	. "---\n"
	. "- foo\n"
	. "...\n",
	[ [ 'foo' ], [ 'foo' ] ],
	'multi_document_space',
	noyamlpm   => 1,
	noyamlperl => 1,
);