File: 15.01.01-global-vars.t

package info (click to toggle)
libje-perl 0.066-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,008 kB
  • sloc: perl: 31,288; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!perl -T
do './t/jstest.pl' or die __DATA__

// ===================================================
// 15.1.1: Non-function global properties
// 9 tests
// ===================================================

ok(NaN != NaN, 'global NaN property')
ok(Infinity + Infinity == Infinity && Infinity > 0 === true,
	'global Infinity property');
ok(typeof undefined == 'undefined', 'global undefined property')

ok(!delete NaN, 'NaN cannot be deleted')
ok(!delete Infinity, 'Infinity cannot be deleted either')
ok(!delete undefined, 'nor can undefined')

NaN = 5;
is(NaN, 5, 'NaN is modifiable')
Infinity = 7
is(Infinity ,7, 'Infinity is modifiable, too')
undefined = 37
is(undefined, 37, 'so is undefined')