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

One test fails with ruby 1.9.3 #3

Closed
bkabrda opened this issue Dec 12, 2011 · 4 comments
Closed

One test fails with ruby 1.9.3 #3

bkabrda opened this issue Dec 12, 2011 · 4 comments

Comments

@bkabrda
Copy link

bkabrda commented Dec 12, 2011

Hi,
one of ical's test fails for me, here is the test output:

  1. Failure:
    test_property_parameters(TestComponent) [/home/bkabrda/rpmbuild/BUILDROOT/rubygem-icalendar-1.1.6-2.fc16.x86_64/usr/share/gems/gems/icalendar-1.1.6/test/test_parameter.rb:31]:
    <{"ALTREP"=>[""http://my.language.net""], "LANGUAGE"=>["SPANISH"]}> expected but was
    <{"ALTREP"=>[]}>.

ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Any ideas?
Thanks,
Bohuslav.

@sdague
Copy link
Contributor

sdague commented Dec 12, 2011

On 12/12/2011 06:43 AM, Bohuslav Kabrda wrote:

Hi,
one of ical's test fails for me, here is the test output:

  1. Failure:
    test_property_parameters(TestComponent) [/home/bkabrda/rpmbuild/BUILDROOT/rubygem-icalendar-1.1.6-2.fc16.x86_64/usr/share/gems/gems/icalendar-1.1.6/test/test_parameter.rb:31]:
    <{"ALTREP"=>[""http://my.language.net""], "LANGUAGE"=>["SPANISH"]}> expected but was
    <{"ALTREP"=>[]}>.

ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]

Is this one of the tests where hash order matters? That seems to change
in interesting ways between versions of ruby.

Also, what distribution is this on?

-Sean

Sean Dague Learn about the Universe with the
sean at dague dot net Mid-Hudson Astronomical Association
http://dague.net http://midhudsonastro.org

@bkabrda
Copy link
Author

bkabrda commented Dec 13, 2011

I'm rebuilding gems with Ruby 1.9.3 for Fedora Rawhide - the new version should land there soon.

I don't think that order matters:
"cals.first.events.first.summary" returns "//my.language.net";LANGUAGE=SPANISH:This is a test summary.", which seems ok, but when you call the ical_params method on it (like "cals.first.events.first.summary.ical_params"), it returns the <{"ALTREP"=>[]}>.

Bohuslav

@ericcf
Copy link
Contributor

ericcf commented Nov 20, 2012

The test passes if you either reverse the hash:

{"LANGUAGE"=>["SPANISH"], "ALTREP"=>["\"http://my.language.net\""]}

or add escaped double quotes to SPANISH:

{"ALTREP"=>["\"http://my.language.net\""], "LANGUAGE"=>["\"SPANISH\""]}

The problem is here: https://github.com/sdague/icalendar/blob/master/lib/icalendar/parser.rb#L199. It does not correctly parse lines like this:

SUMMARY;ALTREP="http://example.com/foo";LANGUAGE=en-US:This is a summary.

The problem is the : in http: because it is a control character within a double-quoted string. I think the regular expressions need some rewriting.

I played around with it, but haven't come up with a good solution yet.

@sdague
Copy link
Contributor

sdague commented Nov 21, 2012

I've got what I think is a workable solution in tree, it seems to support the existing tests. Will be released in 1.2.1

@sdague sdague closed this as completed Nov 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants