Skip to content

Commit

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

Moreover #918 changed 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 correct output because
the input does not match the final implemenation and thus is misleading.

Fixes #1860

Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
  • Loading branch information
AlexanderYastrebov committed Sep 21, 2021
1 parent 11b7aca commit 2615e5d
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 2615e5d

Please sign in to comment.