(t *testing.T)
| 3 | import "testing" |
| 4 | |
| 5 | func TestAnalyzerBasicURLs(t *testing.T) { |
| 6 | a := NewAnalyzer([]byte(` |
| 7 | function foo(){ |
| 8 | document.location = "/logout" |
| 9 | } |
| 10 | `)) |
| 11 | |
| 12 | urls := a.GetURLs() |
| 13 | |
| 14 | if len(urls) < 1 { |
| 15 | t.Errorf("Expected at least 1 URL; got %d", len(urls)) |
| 16 | } |
| 17 | |
| 18 | if urls[0].URL != "/logout" { |
| 19 | t.Errorf("Expected first URL to be '/logout'; got %s", urls[0].URL) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func TestAnalyzerBasicSecrets(t *testing.T) { |
| 24 | a := NewAnalyzer([]byte(` |
nothing calls this directly
no test coverage detected