improved unit test

This commit is contained in:
bjt-user 2024-05-07 00:23:18 +02:00
parent 5c9e297b8b
commit 4b430213d5

View File

@ -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.")
}
}