From 2f68375409d55acb38a410ead7d07cb2c00aa417 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Thu, 22 Sep 2022 17:36:28 +0200 Subject: basic tests for ED and D --- test/autoprepend.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'test') diff --git a/test/autoprepend.t b/test/autoprepend.t index 7cb33e5..beef5e0 100755 --- a/test/autoprepend.t +++ b/test/autoprepend.t @@ -36,3 +36,34 @@ is( "qux gna<bber", "T() with with language and quoted values" ); + +$var = "foo"; +$GLOBALS['debug_edplain'] = 1; +like( + D($var), + '\\$var=\'foo\'', + "D of a variable" +); +like( + D("bar"), + '\'bar\'', + "D of a string" +); + +putenv("IT_ED_STDERR=0"); + +ob_start(); +ED($var); +like( + ob_get_clean(), + '\\$var=\'foo\'', + "ED of a variable" +); + +ob_start(); +ED("bar"); +like( + ob_get_clean(), + '\'bar\'', + "ED of a variable" +); -- cgit v1.2.3