From 6b369a317f187102af75d5ba4eac2ec5e8afd462 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Tue, 1 Mar 2016 14:21:25 +0200 Subject: [PATCH] Compare number approximatively. --- commands_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands_test.go b/commands_test.go index b82b019..334ddd1 100644 --- a/commands_test.go +++ b/commands_test.go @@ -2724,11 +2724,11 @@ var _ = Describe("Commands", func() { // "166.27415156960032" geoDist := client.GeoDist("Sicily", "Palermo", "Catania", "km") 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") 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() {