Skip to content

Commit eb497cc

Browse files
committed
Use approximate value for literal exponentiation checks.
1 parent e939865 commit eb497cc

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

spec/model_literal_spec.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,9 @@ def self.literals(*selector)
585585
"2.7^10.3": [BigDecimal("2.7"), BigDecimal("10.3"), BigDecimal("27736.1879020809118")],
586586
}.each do |name, (n, e, result)|
587587
it name do
588-
expect(RDF::Literal(n) ** RDF::Literal(e)).to eq RDF::Literal(result)
589-
expect((RDF::Literal(n) ** RDF::Literal(e)).datatype).to eq RDF::Literal(result).datatype
588+
value = RDF::Literal(n) ** RDF::Literal(e)
589+
expect(value).to be_within(0.00001).of(result)
590+
expect(value.datatype).to eq RDF::Literal(result).datatype
590591
end
591592
end
592593
end

0 commit comments

Comments
 (0)