Skip to content

Commit

Permalink
Fixes testable example
Browse files Browse the repository at this point in the history
The #1860 pointed out a bug
golang/go#48362 that leads to the false
positive testable example caused by a trailing comment.

Moreover #918 changed the test
input without changing the output and that went unnoticed due to this bug.

This change removes trailing comment to fix the example.
It also removes the test input instead of adding a correct output because
the input syntax is incorrect therefore misleading.

Fixes #1860

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
  • Loading branch information
AlexanderYastrebov committed Sep 21, 2021
1 parent 11b7aca commit e25de60
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions eskip/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ func Example() {
// route definition with a loopback to route2 (no backend address)
route4: Path("/some/alternative/path") -> setPath("/some/other/path") -> <loopback>;
// route definition which forwards rest of requests (no backend address)
route5: * -> requestHeader("X-Type", "page") -> <forward>;
`

routes, err := eskip.Parse(code)
Expand All @@ -72,9 +69,6 @@ func Example() {
// route2: [match] -> [1 filter(s) ->] <shunt> ""
// route3: [match] -> [1 filter(s) ->] <network> "https://api.example.org"
// route4: [match] -> [1 filter(s) ->] <loopback> ""

// TODO: try to represent this compressed output in a nicer way. This is is now somewhat confusing
// considering that it looks almost like eskip but it isn't.
}

func ExampleFilter() {
Expand Down

0 comments on commit e25de60

Please sign in to comment.