From c11198e862e4e8f95700ac18c6f4e10bf7ce0fd5 Mon Sep 17 00:00:00 2001
From: Michiel Cottaar <MichielCottaar@protonmail.com>
Date: Fri, 31 May 2024 11:56:13 +0100
Subject: [PATCH] Allow approximate solutions

---
 test/test_IO.jl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/test_IO.jl b/test/test_IO.jl
index be07ce2..f9ff59c 100644
--- a/test/test_IO.jl
+++ b/test/test_IO.jl
@@ -99,12 +99,12 @@
                     write_sequence(io, seq_orig, format=format)
                     seek(io, 0)
                     seq_json = read_sequence(io, format=format)
-                    @test variables.duration(seq_orig) == variables.duration(seq_json)
+                    @test variables.duration(seq_orig) ≈ variables.duration(seq_json)
                     @test length(seq_orig) == length(seq_json)
-                    @test all(variables.duration.(seq_orig) .== variables.duration.(seq_json))
+                    @test all(variables.duration.(seq_orig) .≈ variables.duration.(seq_json))
                     @test iszero(length(iter_instant_gradients(seq_json)))
                     @test iszero(length(iter_instant_pulses(seq_json)))
-                    @test all(variables.readout_times(seq_json) .== variables.readout_times(seq_orig))
+                    @test all(variables.readout_times(seq_json) .≈ variables.readout_times(seq_orig))
                 end
             end
         end
@@ -118,12 +118,12 @@
                 write_sequence(io, seq_orig; format=format)
                 seek(io, 0)
                 seq_json = read_sequence(io; format=format)
-                @test variables.duration(seq_orig) == variables.duration(seq_json)
+                @test variables.duration(seq_orig) ≈ variables.duration(seq_json)
                 @test length(seq_orig) == length(seq_json)
-                @test all(variables.duration.(seq_orig) .== variables.duration.(seq_json))
+                @test all(variables.duration.(seq_orig) .≈ variables.duration.(seq_json))
                 @test length(iter_instant_gradients(seq_json)) == length(iter_instant_gradients(seq_json))
                 @test length(iter_instant_pulses(seq_json)) == length(iter_instant_pulses(seq_json))
-                @test all(variables.readout_times(seq_json) .== variables.readout_times(seq_orig))
+                @test all(variables.readout_times(seq_json) .≈ variables.readout_times(seq_orig))
             end
         end
     end
-- 
GitLab