From 4b430213d54dce524509c3e2bf3954bffdf4cea1 Mon Sep 17 00:00:00 2001 From: bjt-user Date: Tue, 7 May 2024 00:23:18 +0200 Subject: [PATCH] improved unit test --- main_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main_test.go b/main_test.go index 468e949..a7417f0 100644 --- a/main_test.go +++ b/main_test.go @@ -8,8 +8,8 @@ import ( func TestGet_heading_level(t *testing.T) { level := Get_heading_level("# foo") - if level < 0 || level > 6 { - log.Fatal("Level is not between 0 and 6.") + if level != 1 { + log.Fatal("Level should be 1.") } level = Get_heading_level("not a header") @@ -20,7 +20,7 @@ func TestGet_heading_level(t *testing.T) { level = Get_heading_level("#") - if level < 0 || level > 6 { - log.Fatal("Level is not between 0 and 6.") + if level != 1 { + log.Fatal("Level should be 1.") } }