DwarnL + wa
[p5sagit/Data-Dumper-Concise.git] / t / sugar.t
index 4ca2ecc..7375415 100644 (file)
--- a/t/sugar.t
+++ b/t/sugar.t
@@ -14,11 +14,26 @@ BEGIN {
    }
 }
 
-my @foo = Dwarn 'warn', 'friend';
-is $warned_string,qq{"warn"\n"friend"\n}, 'Dwarn warns';
+DWARNL: {
+   my @foo = DwarnL 'warn', 'friend';
+   is $warned_string,qq{"warn"\n"friend"\n}, 'DwarnL warns';
 
-ok eq_array(\@foo, ['warn','friend']), 'Dwarn passes through correctly';
+   ok eq_array(\@foo, ['warn','friend']), 'DwarnL passes through correctly';
+}
+
+DWARNS: {
+   my $bar = DwarnS 'robot',2,3;
+   is $warned_string,qq{"robot"\n}, 'DwarnS warns';
+   is $bar, 'robot', 'DwarnS passes through correctly';
+}
 
-my $bar = DwarnS 'robot',2,3;
-is $warned_string,qq{"robot"\n}, 'DwarnS warns';
-is $bar, 'robot', 'DwarnS passes through correctly';
+DWARN: {
+   my @foo = Dwarn 'warn', 'friend';
+   is $warned_string,qq{"warn"\n"friend"\n}, 'Dwarn warns lists';
+
+   ok eq_array(\@foo, ['warn','friend']), 'Dwarn passes lists through correctly';
+
+   my $bar = Dwarn 'robot',2,3;
+   is $warned_string,qq{"robot"\n}, 'Dwarn warns scalars correctly';
+   is $bar, 'robot', 'Dwarn passes scalars through correctly';
+}