File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 7
7
"golang.org/x/net/html"
8
8
"os"
9
9
"path/filepath"
10
+ "regexp"
10
11
"strings"
11
12
"testing"
12
13
)
@@ -23,6 +24,16 @@ func TestURLs(t *testing.T) {
23
24
24
25
relPath := strings .TrimPrefix (path , "/usr/src/app/allvbuild" )
25
26
27
+ isArchive , err := regexp .MatchString (`^/v[0-9]+\.[0-9]+/.*` , relPath )
28
+ if err != nil {
29
+ t .Error (err .Error (), "-" , relPath )
30
+ }
31
+ // skip archives for now, only test URLs in current version
32
+ // TODO: test archives
33
+ if isArchive {
34
+ return nil
35
+ }
36
+
26
37
if err != nil {
27
38
t .Error (err .Error (), "-" , relPath )
28
39
}
@@ -44,9 +55,9 @@ func TestURLs(t *testing.T) {
44
55
return nil
45
56
})
46
57
47
- fmt .Println ("found" , count , "html files" )
48
- fmt .Println ("found" , countLinks , "links" )
49
- fmt .Println ("found" , countImages , "images" )
58
+ fmt .Println ("found" , count , "html files (excluding archives) " )
59
+ fmt .Println ("found" , countLinks , "links (excluding archives) " )
60
+ fmt .Println ("found" , countImages , "images (excluding archives) " )
50
61
}
51
62
52
63
// testURLs tests if we're not using absolute paths for URLs
You can’t perform that action at this time.
0 commit comments