move test to tests/

This commit is contained in:
Sky Johnson 2024-08-22 21:50:14 -05:00
parent 048458e52e
commit b391f06121

23
tests/Router_test.go Normal file
View File

@ -0,0 +1,23 @@
package router_test
import (
"testing"
router "git.sharkk.net/Go/Router"
)
func TestHello(t *testing.T) {
r := router.New[string]()
r.Add("GET", "/blog", "Blog")
r.Add("GET", "/blog/post", "Blog post")
data, params := r.Lookup("GET", "/blog")
if data != "Blog" || len(params) != 0 {
t.Error("Invalid data")
}
data, params = r.Lookup("GET", "/blog/post")
if data != "Blog post" || len(params) != 0 {
t.Error("Invalid data")
}
}