Roberto Perez
2011-May-11 10:55 UTC
[Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426)
Hi, I committed in my fork a very small change to solve the bug which is in http://ironruby.codeplex.com/workitem/5426 The commit is in: https://github.com/robjperez/main/commit/7d94882990bc80504a78c7ed9ea989e31b8e19ed The problem was inside the range detector in the delete method. When it finds a ''-'' character, it assumes that the string is a range, but when you use the \ before the ''-'' you are telling that the ''-'' char is a literal. The change was in the File MutableStringOps.cs in the Delete Method. This is my first contribution to IronRuby, so I don''t know if i''m following all the steps in the right order :), so, forgive me if i''m doing wrong but I followed the guides written in github wiki. Shall I proceed with the pull request to main repository, or are you going to review the commit before? Regards. Roberto -- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20110511/7672acb7/attachment.html>
Tomas Matousek
2011-May-11 16:23 UTC
[Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426)
I''ll take a look. Could you add some tests to the specs, unless there already are some? Let me know if you have any questions. Thanks, Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Roberto Perez Sent: Wednesday, May 11, 2011 3:56 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426) Hi, I committed in my fork a very small change to solve the bug which is in http://ironruby.codeplex.com/workitem/5426 The commit is in: https://github.com/robjperez/main/commit/7d94882990bc80504a78c7ed9ea989e31b8e19ed The problem was inside the range detector in the delete method. When it finds a ''-'' character, it assumes that the string is a range, but when you use the \ before the ''-'' you are telling that the ''-'' char is a literal. The change was in the File MutableStringOps.cs in the Delete Method. This is my first contribution to IronRuby, so I don''t know if i''m following all the steps in the right order :), so, forgive me if i''m doing wrong but I followed the guides written in github wiki. Shall I proceed with the pull request to main repository, or are you going to review the commit before? Regards. Roberto -- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20110511/ad5e68e6/attachment.html>
Roberto Perez
2011-May-11 22:26 UTC
[Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426)
Ok I''ll add some tests to check the functionality of this commit. I was trying to add one, but i''m having some problems passing the same "pattern string" due to the difference between ruby syntax and c# one. (As the tests are written in c#) I''ll tell you as soon as I have the test done. Cheers On Wed, May 11, 2011 at 6:23 PM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote:> I?ll take a look. Could you add some tests to the specs, unless there > already are some? Let me know if you have any questions. > > > > Thanks, > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Roberto Perez > *Sent:* Wednesday, May 11, 2011 3:56 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Commit to solve bug: String.delete gives a > wrong result (http://ironruby.codeplex.com/workitem/5426) > > > > Hi, > > > > I committed in my fork a very small change to solve the bug which is in > http://ironruby.codeplex.com/workitem/5426 > > The commit is in: > https://github.com/robjperez/main/commit/7d94882990bc80504a78c7ed9ea989e31b8e19ed > > > > The problem was inside the range detector in the delete method. > > When it finds a ''-'' character, it assumes that the string is a range, but > when you use the \ before the ''-'' you are telling that the ''-'' char is a > literal. > > > > The change was in the File MutableStringOps.cs in the Delete Method. > > > > This is my first contribution to IronRuby, so I don''t know if i''m following > all the steps in the right order :), so, forgive me if i''m doing wrong but I > followed the guides written in github wiki. > > > > Shall I proceed with the pull request to main repository, or are you going > to review the commit before? > > > > Regards. > > Roberto > > > -- > http://zbutton.wordpress.com/ > blog sobre programaci?n y tecnolog?a > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20110512/b57d3a26/attachment-0001.html>
Tomas Matousek
2011-May-11 22:54 UTC
[Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426)
I meant Ruby mspec tests located in Languages\Ruby\Tests\mspec\rubyspec\core\string (for strings). You might find they are already written but disabled. In that case remove the corresponding entries from tags: Languages\Ruby\Tests\mspec\ironruby-tags-19\core\string You can find more on mspec here: https://github.com/rubyspec/mspec Tomas From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Roberto Perez Sent: Wednesday, May 11, 2011 3:27 PM To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426) Ok I''ll add some tests to check the functionality of this commit. I was trying to add one, but i''m having some problems passing the same "pattern string" due to the difference between ruby syntax and c# one. (As the tests are written in c#) I''ll tell you as soon as I have the test done. Cheers On Wed, May 11, 2011 at 6:23 PM, Tomas Matousek <Tomas.Matousek at microsoft.com<mailto:Tomas.Matousek at microsoft.com>> wrote: I''ll take a look. Could you add some tests to the specs, unless there already are some? Let me know if you have any questions. Thanks, Tomas From: ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org> [mailto:ironruby-core-bounces at rubyforge.org<mailto:ironruby-core-bounces at rubyforge.org>] On Behalf Of Roberto Perez Sent: Wednesday, May 11, 2011 3:56 AM To: ironruby-core at rubyforge.org<mailto:ironruby-core at rubyforge.org> Subject: [Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426) Hi, I committed in my fork a very small change to solve the bug which is in http://ironruby.codeplex.com/workitem/5426 The commit is in: https://github.com/robjperez/main/commit/7d94882990bc80504a78c7ed9ea989e31b8e19ed The problem was inside the range detector in the delete method. When it finds a ''-'' character, it assumes that the string is a range, but when you use the \ before the ''-'' you are telling that the ''-'' char is a literal. The change was in the File MutableStringOps.cs in the Delete Method. This is my first contribution to IronRuby, so I don''t know if i''m following all the steps in the right order :), so, forgive me if i''m doing wrong but I followed the guides written in github wiki. Shall I proceed with the pull request to main repository, or are you going to review the commit before? Regards. Roberto -- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20110511/76b88394/attachment.html>
Roberto Perez
2011-May-13 19:41 UTC
[Ironruby-core] Commit to solve bug: String.delete gives a wrong result (http://ironruby.codeplex.com/workitem/5426)
Hi! There was no test to check this problem so i added it to the spec file in this commit: https://github.com/robjperez/main/commit/83f87a4ab1573511bb4de00a7b57c10ea441c5ee I added this: "he-lo".delete(''\-\'''').should == "helo" which fails in current version but is fixed in the commit I mailed before. In the tags file, there was no tag regarding this issue. There is a tag regarding another excepcion with ranges, but I think it is not about this one. Cheers Roberto. On Thu, May 12, 2011 at 12:54 AM, Tomas Matousek < Tomas.Matousek at microsoft.com> wrote:> I meant Ruby mspec tests located in > Languages\Ruby\Tests\mspec\rubyspec\core\string (for strings). > > You might find they are already written but disabled. In that case remove > the corresponding entries from tags: > > Languages\Ruby\Tests\mspec\ironruby-tags-19\core\string > > > > You can find more on mspec here: https://github.com/rubyspec/mspec > > > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Roberto Perez > *Sent:* Wednesday, May 11, 2011 3:27 PM > > *To:* ironruby-core at rubyforge.org > *Subject:* Re: [Ironruby-core] Commit to solve bug: String.delete gives a > wrong result (http://ironruby.codeplex.com/workitem/5426) > > > > Ok I''ll add some tests to check the functionality of this commit. > > > > I was trying to add one, but i''m having some problems passing the same > "pattern string" due to the difference between ruby syntax and c# one. (As > the tests are written in c#) > > > > I''ll tell you as soon as I have the test done. > > > > Cheers > > > > On Wed, May 11, 2011 at 6:23 PM, Tomas Matousek < > Tomas.Matousek at microsoft.com> wrote: > > I?ll take a look. Could you add some tests to the specs, unless there > already are some? Let me know if you have any questions. > > > > Thanks, > > Tomas > > > > *From:* ironruby-core-bounces at rubyforge.org [mailto: > ironruby-core-bounces at rubyforge.org] *On Behalf Of *Roberto Perez > *Sent:* Wednesday, May 11, 2011 3:56 AM > *To:* ironruby-core at rubyforge.org > *Subject:* [Ironruby-core] Commit to solve bug: String.delete gives a > wrong result (http://ironruby.codeplex.com/workitem/5426) > > > > Hi, > > > > I committed in my fork a very small change to solve the bug which is in > http://ironruby.codeplex.com/workitem/5426 > > The commit is in: > https://github.com/robjperez/main/commit/7d94882990bc80504a78c7ed9ea989e31b8e19ed > > > > The problem was inside the range detector in the delete method. > > When it finds a ''-'' character, it assumes that the string is a range, but > when you use the \ before the ''-'' you are telling that the ''-'' char is a > literal. > > > > The change was in the File MutableStringOps.cs in the Delete Method. > > > > This is my first contribution to IronRuby, so I don''t know if i''m following > all the steps in the right order :), so, forgive me if i''m doing wrong but I > followed the guides written in github wiki. > > > > Shall I proceed with the pull request to main repository, or are you going > to review the commit before? > > > > Regards. > > Roberto > > > -- > http://zbutton.wordpress.com/ > blog sobre programaci?n y tecnolog?a > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > > > > > -- > http://zbutton.wordpress.com/ > blog sobre programaci?n y tecnolog?a > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core > >-- http://zbutton.wordpress.com/ blog sobre programaci?n y tecnolog?a -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20110513/d00d2e0b/attachment-0001.html>