move test to tests/
This commit is contained in:
parent
048458e52e
commit
b391f06121
23
tests/Router_test.go
Normal file
23
tests/Router_test.go
Normal 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")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user