From 84660f52dded89e3affdff636f8bdfa2adfe3629 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Fri, 9 Apr 2010 13:47:33 -0400 Subject: [PATCH] added unit tests for format_options --- unit_tests/db.php | 2 +- unit_tests/format.php | 39 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/unit_tests/db.php b/unit_tests/db.php index 4906f1b..f6b5325 100644 --- a/unit_tests/db.php +++ b/unit_tests/db.php @@ -1,6 +1,6 @@ 'Eno', 'two' => 'Owt', 'symbols&\'"' => 'Slobmys'), PULLDOWN_HASH); + $errors +=_test_format_options('hash', 'one', 'one'); + $errors +=_test_format_options('hash', 'One', ''); + $errors +=_test_format_options('hash', 'two', 'two'); + $errors +=_test_format_options('hash', 'symbols&\'"', ''); + pulldown('array_2d', array(array('one', 'Eno'), array('two', 'Owt'), array('symbols&\'"', 'Slobmys')), PULLDOWN_2D); + $errors +=_test_format_options('array_2d', 'one', 'one'); + $errors +=_test_format_options('array_2d', 'One', ''); + $errors +=_test_format_options('array_2d', 'two', 'two'); + $errors +=_test_format_options('array_2d', 'symbols&\'"', ''); + + return $errors; +} + +# returns number of errors function format_unit_tests_main() { $errors = 0; $errors += test_format_money(); $errors += test_format_misc(); + $errors += test_format_options(); return $errors; } -- 1.7.10.4