File: numbers.t

package info (click to toggle)
libyaml-libyaml-perl 0.76%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 688 kB
  • sloc: perl: 1,603; ansic: 1,140; sh: 29; makefile: 4
file content (78 lines) | stat: -rw-r--r-- 1,100 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
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
use FindBin '$Bin';
use lib $Bin;
use TestYAMLTests tests => 6;

my ($a, $b, $c, $d) = (42, "42", 42, "42");
my $e = ">$c<";
my $f = $d + 3;

{
is Dump($a, $b, $c, $d), <<'...', "Dumping Integers and Strings";
--- 42
--- '42'
--- 42
--- 42
...

my ($num, $float, $str) = Load(<<'...');
--- 42
--- 0.333
--- '02134'
...

is Dump($num, $float, $str), <<'...', "Round tripping integers and strings";
--- 42
--- 0.333
--- '02134'
...

}

{
local $YAML::XS::QuoteNumericStrings = 1;

is Dump($a, $b, $c, $d), <<'...', "Dumping Integers and Strings";
--- 42
--- '42'
--- 42
--- 42
...

my ($num, $float, $str) = Load(<<'...');
--- 42
--- 0.333
--- '02134'
...

is Dump($num, $float, $str), <<'...', "Round tripping integers and strings";
--- 42
--- 0.333
--- '02134'
...

}

{
local $YAML::XS::QuoteNumericStrings = 0;

is Dump($a, $b, $c, $d), <<'...', "Dumping Integers and Strings";
--- 42
--- 42
--- 42
--- 42
...

my ($num, $float, $str) = Load(<<'...');
--- 42
--- 0.333
--- '02134'
...

is Dump($num, $float, $str), <<'...', "Round tripping integers and strings";
--- 42
--- 0.333
--- 02134
...

}