<div dir="ltr"><div class="gmail_quote">On Sun, Dec 30, 2012 at 11:24 PM, moshe nahmias <span dir="ltr"><<a href="mailto:moshegrey@ubuntu.com" target="_blank">moshegrey@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">As far as I know the tests are supposed to work as any other script/programs so if the program works the test is supposed to work too.<br></div></blockquote><div><br>Yes, and no.<br><br>A test provides a compartmentalized environment for running the application code. That's the "yes" part.<br>
However, this environment might be a bit different. Environment variables, harness, etc. That's the "no" part.<br>It drifts more into the "yes" part though, so that's the good news. :)<br> <br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>it doesn't work with the code like shown above if I write in the terminal ./input.t BUT if I write ./input.t something (any character at all) it pass the test.<br>
<br></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<br>Why? What makes the difference? As far as I understand it there is no difference in the code on the program and on the test (if you want me to copy all the code till that point I can do it)<br></div></blockquote><div>
<br>The problem is that you're using the diamond operator (<>), which is... "magical" and DWIMmish.<br><a href="http://www.stat.berkeley.edu/~spector/extension/perl/notes/node46.html">http://www.stat.berkeley.edu/~spector/extension/perl/notes/node46.html</a><br>
<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br>One more thing, I want to check for the possibility that the user will enter just one or two parameters in the input, but the object doesn't forget the parameters I got in, does that mean I have to make more objects ( or rewrite the data) or there is a better way?<span class="HOEnZb"><font color="#888888"><br>
</font></span></div></blockquote><div><br>You should separate the fetching of information from STDIN/ARGV and parsing them. That would make it much easier to test.<br></div></div></div>