Compare number approximatively.

This commit is contained in:
Vladimir Mihailenco 2016-03-01 14:21:25 +02:00
parent 9c261facce
commit 6b369a317f
1 changed files with 2 additions and 2 deletions

View File

@ -2724,11 +2724,11 @@ var _ = Describe("Commands", func() {
// "166.27415156960032" // "166.27415156960032"
geoDist := client.GeoDist("Sicily", "Palermo", "Catania", "km") geoDist := client.GeoDist("Sicily", "Palermo", "Catania", "km")
Expect(geoDist.Err()).NotTo(HaveOccurred()) Expect(geoDist.Err()).NotTo(HaveOccurred())
Expect(geoDist.Val()).To(Equal(166.27415156960032)) Expect(geoDist.Val()).To(BeNumerically("~", 166.27, 0.01))
geoDist = client.GeoDist("Sicily", "Palermo", "Catania", "m") geoDist = client.GeoDist("Sicily", "Palermo", "Catania", "m")
Expect(geoDist.Err()).NotTo(HaveOccurred()) Expect(geoDist.Err()).NotTo(HaveOccurred())
Expect(geoDist.Val()).To(Equal(166274.15156960033)) Expect(geoDist.Val()).To(BeNumerically("~", 166274.15, 0.01))
}) })
It("should get geo hash in string representation", func() { It("should get geo hash in string representation", func() {