NaN values prevent a test passing due to NaN inequality

Bug #932534 reported by Dan Kortschak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gocheck
New
Undecided
Unassigned

Bug Description

I have just upgraded to weekly.2012-02-07 and tried a test of my packages (under development) and I get a test failure with the following report:

----------------------------------------------------------------------
FAIL: gff_test.go:86: gff.(*S).TestReadGFF

gff_test.go:108:
    c.Check(*obtain[j], check.Equals, expect[j])
... obtained feat.Feature = feat.Feature{ID:"SEQ1:102..105", Source:"EMBL", Location:"SEQ1", Start:102, End:105, Feature:"atg", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:0, Strand:1, Moltype:0, Meta:interface {}(nil)}
... expected feat.Feature = feat.Feature{ID:"SEQ1:102..105", Source:"EMBL", Location:"SEQ1", Start:102, End:105, Feature:"atg", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:0, Strand:1, Moltype:0, Meta:interface {}(nil)}

gff_test.go:108:
    c.Check(*obtain[j], check.Equals, expect[j])
... obtained feat.Feature = feat.Feature{ID:"SEQ1:102..172", Source:"EMBL", Location:"SEQ1", Start:102, End:172, Feature:"exon", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:0, Strand:1, Moltype:0, Meta:interface {}(nil)}
... expected feat.Feature = feat.Feature{ID:"SEQ1:102..172", Source:"EMBL", Location:"SEQ1", Start:102, End:172, Feature:"exon", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:0, Strand:1, Moltype:0, Meta:interface {}(nil)}

gff_test.go:108:
    c.Check(*obtain[j], check.Equals, expect[j])
... obtained feat.Feature = feat.Feature{ID:"SEQ1:171..173", Source:"EMBL", Location:"SEQ1", Start:171, End:173, Feature:"splice5", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:-1, Strand:1, Moltype:0, Meta:interface {}(nil)}
... expected feat.Feature = feat.Feature{ID:"SEQ1:171..173", Source:"EMBL", Location:"SEQ1", Start:171, End:173, Feature:"splice5", Score:NaN, Probability:0, Attributes:"", Comments:"", Frame:-1, Strand:1, Moltype:0, Meta:interface {}(nil)}

OOPS: 3 passed, 1 FAILED
--- FAIL: Test (0.02 seconds)

This failure appears to be due to the NaN inequality as setting these values to 0 allows the test to pass.

A work around is to compare the structs as strings.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.