Git Product home page Git Product logo

Comments (4)

sdague avatar sdague commented on June 21, 2024

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

from icalendar.

bkabrda avatar bkabrda commented on June 21, 2024

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

from icalendar.

ericcf avatar ericcf commented on June 21, 2024

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.

from icalendar.

sdague avatar sdague commented on June 21, 2024

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

from icalendar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.