summaryrefslogtreecommitdiff
path: root/lib/path/route_example_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/path/route_example_test.go')
-rw-r--r--lib/path/route_example_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/path/route_example_test.go b/lib/path/route_example_test.go
index 93799773..3baa730f 100644
--- a/lib/path/route_example_test.go
+++ b/lib/path/route_example_test.go
@@ -94,6 +94,31 @@ func ExampleRoute_Parse() {
// false map[]
}
+func ExampleRoute_Path() {
+ var (
+ rute *libpath.Route
+ err error
+ )
+
+ rute, err = libpath.NewRoute(`/:user/:repo`)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Println(rute.Path())
+
+ rute.Set(`user`, `shuLhan`)
+ fmt.Println(rute.Path())
+
+ rute.Set(`repo`, `pakakeh.go`)
+ fmt.Println(rute.Path())
+
+ // Output:
+ // //
+ // /shuLhan/
+ // /shuLhan/pakakeh.go
+}
+
func ExampleRoute_Set() {
var (
rute *libpath.Route