2024-05-06 23:12:35 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestGet_heading_level(t *testing.T) {
|
|
|
|
level := Get_heading_level("# foo")
|
|
|
|
|
2024-05-07 00:23:18 +02:00
|
|
|
if level != 1 {
|
|
|
|
log.Fatal("Level should be 1.")
|
2024-05-06 23:12:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
level = Get_heading_level("not a header")
|
|
|
|
|
|
|
|
if level != 0 {
|
|
|
|
log.Fatal("A non header should be level 0!")
|
|
|
|
}
|
|
|
|
|
|
|
|
level = Get_heading_level("#")
|
|
|
|
|
2024-05-07 00:23:18 +02:00
|
|
|
if level != 1 {
|
|
|
|
log.Fatal("Level should be 1.")
|
2024-05-06 23:12:35 +02:00
|
|
|
}
|
|
|
|
}
|