bver/GERET

one failing unit test in test/tc_semantic_functions.rb

Closed this issue · 2 comments

When running the initial test suite test/ts_all.rb, the following test is the only one not passing under Ruby 1.9.1+:

  1) Failure:
test_parse(TC_SemanticFunctions) [./test/tc_semantic_functions.rb:86]:
<["_text", "_valid", "id", "x", "y"]> expected but was
<["_text", "_valid", "x", "id", "y"]>.

I'm thinking it's because Hash keys retain the order in which they're added under 1.9 (unlike 1.8).

bver commented

Unable to reproduce with ruby 1.9.1p243 -- BUT:

this is indeed a Hash#keys related issue. It seams the observed behavior depends on the order of symbol sections parsed by the YAML::load method.
Semanitic::Functions#initialize is therefore fixed and symbols are processed in the alphabetical order now.

The unit tests should pass on all platforms supporting ruby 1.8 or 1.9, however, there is no "implicit" need to keep symbols ordered when processing semantic functions.

bver commented

fixed a long time ago.