<?php
/* SOME TESTS ARE MEANT TO FAIL!
If the entire script runs, it works. */
require_once('../../../Data/Types/LexicographicList.php');
use Falcraft\Data\Types;
echo "Falcraft\\Data\\Types\\LexicographicList.php Test\n";
echo "----------------------------------------------\n\n";
echo "Instantiate -> ";
$success = true;
$testList = null;
try {
$testList = new Types\LexicographicList();
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "Create Strict List -- ";
$success = true;
$testList = null;
try {
$testList = new Types\LexicographicList(array(), null, array('strict' => true,));
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo " Push Improper Value -> ";
$fail = true;
try {
$testList->push(5);
$fail = false;
} catch (\Exception $e) {
}
if ($fail) {
echo "Failure!\n";
} else {
echo "Success...\n";
}
echo "Push 'abecedarian' -> ";
$success = true;
try {
$testList->push('abecedarian');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "Push 'zygote' -> ";
$success = true;
try {
$testList->push('zygote');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "Push 'green' -> ";
try {
$testList->push('green');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "Push 'wash' -> ";
try {
$testList->push('wash');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "Push 'real' -> ";
try {
$testList->push('real');
} catch (\Exception $e) {
$success = false;
}
if ($success) {
echo "Success!\n";
} else {
echo "Failure...\n";
}
echo "List Internals -- ";
var_dump($testList->getList());
|