Skip to content

Commit 9aaad06

Browse files
author
e1himself
committed
Add a unit test for lime unit-testing lib
It's stupid noone did this before.
1 parent 69e1d42 commit 9aaad06

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

test/unit/test/limeTestTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
3+
require_once(__DIR__.'/../../bootstrap/unit.php');
4+
5+
$t = new lime_test(23);
6+
7+
$t->comment('A. Equal numbers');
8+
$t->is(1, 1);
9+
$t->is(2, 2);
10+
$t->is(-100, -100);
11+
$t->is(0, 0);
12+
13+
$t->comment('B. Equal strings');
14+
$t->is('', '');
15+
$t->is('A', 'A');
16+
$t->is('aaa', 'aaa');
17+
$t->is("\0", "\0");
18+
19+
$t->comment('C. Equivalent number <-> strings');
20+
$t->is('0', 0);
21+
$t->is('1', 1);
22+
$t->is('-1', -1);
23+
$t->is('10000000.0', 10000000.0);
24+
25+
$t->comment('D. Not equal numbers');
26+
$t->isnt(10, 1);
27+
$t->isnt(-2, 2);
28+
$t->isnt(100, 100.1);
29+
$t->isnt(0, -1);
30+
$t->isnt(-2, 'Hello');
31+
$t->isnt(100, array(100));
32+
33+
$t->comment('E. Equivalent falsy');
34+
$t->is(0, false);
35+
$t->is(0, null);
36+
$t->is('', 0);
37+
$t->is(false, null);
38+
$t->is(array(), null);

0 commit comments

Comments
 (0)