File: quote.t

package info (click to toggle)
libyaml-libyaml-perl 0.38-3%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,640 kB
  • sloc: ansic: 8,213; perl: 4,808; makefile: 465
file content (37 lines) | stat: -rw-r--r-- 507 bytes parent folder | download | duplicates (5)
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
use t::TestYAMLTests tests => 4;

is Dump('', [''], {foo => ''}), <<'...', 'Dumped empty string is quoted';
--- ''
---
- ''
---
foo: ''
...

is Dump({}, [{}], {foo => {}}), <<'...', 'Dumped empty map is {}';
--- {}
---
- {}
---
foo: {}
...

is Dump([], [[]], {foo => []}), <<'...', 'Dumped empty seq is []';
--- []
---
- []
---
foo: []
...

is Dump(['&1', '*1', '|2', '? foo', 'x: y', "\a\t\n\r"]), <<'...',
---
- '&1'
- '*1'
- '|2'
- '? foo'
- 'x: y'
- "\a\t\n\r"
...
'Dumped special scalars get quoted';