File: yaml_parse_spec_float.phpt

package info (click to toggle)
php-yaml 2.0.2%2B1.3.1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 904 kB
  • sloc: ansic: 4,832; xml: 751; makefile: 1
file content (30 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (13)
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
--TEST--
Yaml 1.1 Spec - float
--SKIPIF--
<?php if(!extension_loaded('yaml')) die('skip yaml n/a'); ?>
--FILE--
<?php
  var_dump(yaml_parse('
canonical: 6.8523015e+5
exponentioal: 685.230_15e+03
fixed: 685_230.15
sexagesimal: 190:20:30.15
negative infinity: -.inf
not a number: .NaN
'));
?>
--EXPECT--
array(6) {
  ["canonical"]=>
  float(685230.15)
  ["exponentioal"]=>
  float(685230.15)
  ["fixed"]=>
  float(685230.15)
  ["sexagesimal"]=>
  float(685230.15)
  ["negative infinity"]=>
  float(-INF)
  ["not a number"]=>
  float(NAN)
}