File: utils_test.go

package info (click to toggle)
golang-github-fasthttp-router 1.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 284 kB
  • sloc: makefile: 3
file content (17 lines) | stat: -rw-r--r-- 436 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package router

import "testing"

func Test_validatePath(t *testing.T) {
	if err := catchPanic(func() { validatePath("") }); err == nil {
		t.Error("an error was expected with an empty path")
	}

	if err := catchPanic(func() { validatePath("foo") }); err == nil {
		t.Error("an error was expected with an empty path")
	}

	if err := catchPanic(func() { validatePath("/foo") }); err != nil {
		t.Errorf("unexpected error: %v", err)
	}
}