summaryrefslogtreecommitdiff
path: root/test/autoprepend.t
diff options
context:
space:
mode:
authorNathan Gass2022-09-22 17:36:28 +0200
committerNathan Gass2022-09-22 17:36:28 +0200
commit2f68375409d55acb38a410ead7d07cb2c00aa417 (patch)
tree59c90ceb87c24d8d81bbe706a876b7858b006fbc /test/autoprepend.t
parentd1522ded3aa85221d8f2671164564ea691aefecc (diff)
downloaditools-2f68375409d55acb38a410ead7d07cb2c00aa417.tar.gz
itools-2f68375409d55acb38a410ead7d07cb2c00aa417.tar.bz2
itools-2f68375409d55acb38a410ead7d07cb2c00aa417.zip
basic tests for ED and D
Diffstat (limited to 'test/autoprepend.t')
-rwxr-xr-xtest/autoprepend.t31
1 files changed, 31 insertions, 0 deletions
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"
+);