summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRenée Bäcker <renee.baecker@smart-websolutions.de>2010-10-04 06:26:21 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-04 08:25:01 -0700
commita5b92898b77edcbff06468ccf67150e50d1703e4 (patch)
tree481ffe556c805910c7d79a0a2b314bb9fcb98f43 /t
parentb2a2a9010bb3413ad9c32e455d93e01069d0fd73 (diff)
downloadperl-a5b92898b77edcbff06468ccf67150e50d1703e4.tar.gz
[perl #57706] Unary minus on 'numeric' inputs like '-1'
The attached patch adds the conversion if the value of the SV looks_like_number.
Diffstat (limited to 't')
-rw-r--r--t/op/negate.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/op/negate.t b/t/op/negate.t
index fb8d4b49e8..abe82bf6d3 100644
--- a/t/op/negate.t
+++ b/t/op/negate.t
@@ -18,8 +18,8 @@ is(- -10, 10, "Simple numeric negation to positive");
is(-"10", -10, "Negation of a positive string to negative");
is(-"10.0", -10, "Negation of a positive decimal sting to negative");
is(-"10foo", -10, "Negation of a numeric-lead string returns negation of numeric");
-is(-"-10", "+10", 'Negation of string starting with "-" returns a string starting with "+" - numeric');
-is(-"-10.0", "+10.0", 'Negation of string starting with "-" returns a string starting with "+" - decimal');
+is(-"-10", 10, 'Negation of string starting with "-" returns a string starting with "+" - numeric');
+is(-"-10.0", 10.0, 'Negation of string starting with "-" returns a string starting with "+" - decimal');
is(-"-10foo", "+10foo", 'Negation of string starting with "-" returns a string starting with "+" - non-numeric');
is(-"xyz", "-xyz", 'Negation of a negative string adds "-" to the front');
is(-"-xyz", "+xyz", "Negation of a negative string to positive");