File: 14_yaml_org.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 (63 lines) | stat: -rw-r--r-- 1,194 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
#!/usr/bin/perl

# Testing of common META.yml examples

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

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





#####################################################################
# Testing that Perl::Smith config files work

my $sample_file = catfile( test_data_directory(), 'sample.yml' );
my $sample      = load_ok( 'sample.yml', $sample_file, 500 );

yaml_ok(
	$sample,
	[ {
		invoice   => 34843,
		date      => '2001-01-23',
		'bill-to' => {
			given  => 'Chris',	
			family => 'Dumars',
			address => {
				lines  => "458 Walkman Dr.\nSuite #292\n",
				city   => 'Royal Oak',
				state  => 'MI',
				postal => 48046,
			},
		},
		product => [
			{
				sku         => 'BL394D',
				quantity    => '4',
				description => 'Basketball',
				price       => '450.00',
			},
			{
				sku         => 'BL4438H',
				quantity    => '1',
				description => 'Super Hoop',
				price       => '2392.00',
			},
		],
		tax      => '251.42',
		total    => '4443.52',
		comments => <<'END_TEXT',
Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.
END_TEXT
	} ],
	'sample.yml',
	# nosyck => 1,
);