From d6cc1bc7d95d11d1ec5f15e5c5399085041d83f5 Mon Sep 17 00:00:00 2001
From: Tamas Gal <himself@tamasgal.com>
Date: Thu, 5 Dec 2024 11:57:16 +0100
Subject: [PATCH] Add tests for haslocation/hasstring

---
 test/hardware.jl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/test/hardware.jl b/test/hardware.jl
index 66afa78a..7595fb55 100644
--- a/test/hardware.jl
+++ b/test/hardware.jl
@@ -113,6 +113,13 @@ end
         @test 0 < length(det)
     end
 end
+@testset "DETX tools" begin
+    det = Detector(datapath("detx", "orca_115strings_av20min17mhorizontal_18OMs_alt9mvertical_v2.detx"))
+    @test haslocation(det, Location(1, 1))
+    @test !haslocation(det, Location(1, 100))
+    @test hasstring(det, 1)
+    @test !hasstring(det, 200)
+end
 @testset "DETX floor == -1 bug" begin
     det = Detector(datapath("detx", "orca_115strings_av20min17mhorizontal_18OMs_alt9mvertical_v2.detx"))
     @test Location(1, 1) == det[1].location
-- 
GitLab