From 37c9ffcf7d12dcd3218fa7956c7a9adf5604a7b2 Mon Sep 17 00:00:00 2001 From: Bart Jorgensen Date: Thu, 19 Jan 2012 12:08:58 +1300 Subject: [PATCH] Bug 5327 added unit tests for C4/TmplToken.pm Signed-off-by: Chris Hall --- t/TmplToken.t | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/t/TmplToken.t b/t/TmplToken.t index b9f1612594..579ee9d591 100755 --- a/t/TmplToken.t +++ b/t/TmplToken.t @@ -6,7 +6,7 @@ use strict; use warnings; use C4::TmplTokenType; -use Test::More tests => 7; +use Test::More tests => 19; BEGIN { use_ok('C4::TmplToken'); @@ -20,3 +20,27 @@ ok ($token->pathname eq '/tmp/translate.txt', "Path works"); ok ($token->text_p, "text_p works"); + +is($token-> children(), undef, "testing children returns undef when given argument"); + +ok($token-> set_children(), "testing set_children with no arguments"); + +is($token-> parameters_and_fields(), "0", "testing Parameters and fields returns 0 when given argument"); + +is($token-> anchors(), "0", "testing anchors returns 0 when given argument"); + +is($token-> form(),undef, "testing form returns undef when given argument"); + +ok($token-> set_form(), "testing set_form with no arguments"); + +is($token-> js_data(),undef, "testing form returns undef when given argument"); + +ok($token-> set_js_data(), "testing set_js_data with no arguments"); + +is($token-> tag_p(),"", "testing tag_p returns '' when given argument"); + +is($token-> cdata_p(),"", "testing cdata_p returns '' when given argument"); + +is($token-> text_parametrized_p(),"", "testing text_parametrized returns '' when given argument"); + +is($token-> directive_p(),"", "testing directive_p returns '' when given argument"); -- 2.39.5