@@ -17,8 +17,9 @@ import (
17
17
)
18
18
19
19
var localMetas = map [string ]string {
20
- "user" : "gogits" ,
21
- "repo" : "gogs" ,
20
+ "user" : "gogits" ,
21
+ "repo" : "gogs" ,
22
+ "repoPath" : "../../integrations/gitea-repositories-meta/user13/repo11.git/" ,
22
23
}
23
24
24
25
func TestRender_Commits (t * testing.T ) {
@@ -30,19 +31,20 @@ func TestRender_Commits(t *testing.T) {
30
31
assert .Equal (t , strings .TrimSpace (expected ), strings .TrimSpace (buffer ))
31
32
}
32
33
33
- var sha = "b6dd6210eaebc915fd5be5579c58cce4da2e2579 "
34
+ var sha = "65f1bf27bc3bf70f64657658635e66094edbcb4d "
34
35
var commit = util .URLJoin (AppSubURL , "commit" , sha )
35
36
var subtree = util .URLJoin (commit , "src" )
36
37
var tree = strings .Replace (subtree , "/commit/" , "/tree/" , - 1 )
37
38
38
- test (sha , `<p><a href="` + commit + `" rel="nofollow"><code>b6dd6210ea </code></a></p>` )
39
- test (sha [:7 ], `<p><a href="` + commit [:len (commit )- (40 - 7 )]+ `" rel="nofollow"><code>b6dd621 </code></a></p>` )
40
- test (sha [:39 ], `<p><a href="` + commit [:len (commit )- (40 - 39 )]+ `" rel="nofollow"><code>b6dd6210ea </code></a></p>` )
41
- test (commit , `<p><a href="` + commit + `" rel="nofollow"><code>b6dd6210ea </code></a></p>` )
42
- test (tree , `<p><a href="` + tree + `" rel="nofollow"><code>b6dd6210ea /src</code></a></p>` )
43
- test ("commit " + sha , `<p>commit <a href="` + commit + `" rel="nofollow"><code>b6dd6210ea </code></a></p>` )
39
+ test (sha , `<p><a href="` + commit + `" rel="nofollow"><code>65f1bf27bc </code></a></p>` )
40
+ test (sha [:7 ], `<p><a href="` + commit [:len (commit )- (40 - 7 )]+ `" rel="nofollow"><code>65f1bf2 </code></a></p>` )
41
+ test (sha [:39 ], `<p><a href="` + commit [:len (commit )- (40 - 39 )]+ `" rel="nofollow"><code>65f1bf27bc </code></a></p>` )
42
+ test (commit , `<p><a href="` + commit + `" rel="nofollow"><code>65f1bf27bc </code></a></p>` )
43
+ test (tree , `<p><a href="` + tree + `" rel="nofollow"><code>65f1bf27bc /src</code></a></p>` )
44
+ test ("commit " + sha , `<p>commit <a href="` + commit + `" rel="nofollow"><code>65f1bf27bc </code></a></p>` )
44
45
test ("/home/gitea/" + sha , "<p>/home/gitea/" + sha + "</p>" )
45
-
46
+ test ("deadbeef" , `<p>deadbeef</p>` )
47
+ test ("d27ace93" , `<p>d27ace93</p>` )
46
48
}
47
49
48
50
func TestRender_CrossReferences (t * testing.T ) {
0 commit comments