Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

&eval of empty string returns 1 in Rakudo #1700

Closed
p6rt opened this issue Apr 17, 2010 · 7 comments
Closed

&eval of empty string returns 1 in Rakudo #1700

p6rt opened this issue Apr 17, 2010 · 7 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Apr 17, 2010

Migrated from rt.perl.org#74448 (status was 'resolved')

Searchable as RT74448$

@p6rt
Copy link
Author

p6rt commented Apr 17, 2010

From @masak

<masak> rakudo​: say eval ""
<p6eval> rakudo 78faa0​: OUTPUT«1␤»
<masak> may I ask... why 1?
<moritz_> rakudo​: say (eval "").WHAT
<p6eval> rakudo 78faa0​: OUTPUT«Int()␤»
<moritz_> it should return Nil, really
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Apr 22, 2010

From @kyleha

This is an automatically generated mail to inform you that tests are now available in t/spec/S02-builtin_data_types/nil.t

commit 8d42030b8328cf141ebdce17f29835672f6f99c0
Author​: kyle <kyle@​c213334d-75ef-0310-aa23-eaa082d1ae64>
Date​: Thu Apr 22 21​:10​:20 2010 +0000

  Test for RT 74448​: eval of empty string should be Nil
 
  git-svn-id​: http://svn.pugscode.org/pugs@&#8203;30453 c213334d-75ef-0310-aa23-eaa082d1ae64

Inline Patch
diff --git a/t/spec/S02-builtin_data_types/nil.t b/t/spec/S02-builtin_data_types/nil.t
index 6b0337c..688f97b 100644
--- a/t/spec/S02-builtin_data_types/nil.t
+++ b/t/spec/S02-builtin_data_types/nil.t
@@ -10,6 +10,7 @@ sub empty_do { do {} }
 sub empty_branch_true { if 1 {} else { 1; } }
 sub empty_branch_false { if 0 { 1; } else {} }
 sub bare_return { return; }
+sub rt74448 { eval '' }
 
 #?rakudo 4 skip 'return value of if/for etc'
 ok empty_sub()          ~~ Nil, 'empty sub returns Nil';
@@ -17,6 +18,8 @@ ok empty_do()           ~~ Nil, 'do {} is Nil';
 ok empty_branch_true()  ~~ Nil, 'if 1 {} is Nil';
 ok empty_branch_false() ~~ Nil, 'else {} is Nil';
 ok bare_return()        ~~ Nil, 'bare return returns Nil';
+#?rakudo todo 'RT 74448: eval of empty string should be Nil'
+ok rt74448()            ~~ Nil, 'eval of empty string is Nil';
 
 # RT #63894
 {

@p6rt
Copy link
Author

p6rt commented Apr 22, 2010

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

On * release

perl6 -e 'say eval ""'

(no output)

$ perl6 -e 'say (eval "").WHAT'
Parcel()

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

[14​:13] <bbkr> I have question regarding
http://rt.perl.org/rt3/Ticket/Display.html?id=74448 - eval of empty
string returns nor Parcel (task says it should return Nil). but Parcel
~~ Nil so it will pass testcase proposed in ticket. does that meas that
test can be unfudged and ticket marked as resolved?
[14​:14] <bbkr> s/nor/now/
[14​:15] <moritz_> rakudo​: say eval('').perl
[14​:15] <p6eval> rakudo 0a8ef0​: OUTPUT«()␤»
[14​:15] <moritz_> rakudo​: say eval('').WHAT
[14​:15] <p6eval> rakudo 0a8ef0​: OUTPUT«Parcel()␤»
[14​:16] <moritz_> bbkr​: can be closed

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

From @bbkr

this test is already unfudged in 31891 revision
closing ticket

@p6rt
Copy link
Author

p6rt commented Aug 3, 2010

@bbkr - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Aug 3, 2010
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant