-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from nginxinc/empty-path-nginxplus
Added handling empty path in Ingress resource for NGINX Plus Controller
- Loading branch information
Showing
4 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package controller | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestPathOrDefaultReturnDefault(t *testing.T) { | ||
path := "" | ||
expected := "/" | ||
if pathOrDefault(path) != expected { | ||
t.Errorf("pathOrDefault(%q) should return %q", path, expected) | ||
} | ||
} | ||
|
||
func TestPathOrDefaultReturnActual(t *testing.T) { | ||
path := "/path/to/resource" | ||
if pathOrDefault(path) != path { | ||
t.Errorf("pathOrDefault(%q) should return %q", path, path) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters