diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-05-31 13:35:57 +0200 |
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-05-31 13:35:57 +0200 |
| commit | f005e32ae0a22017452a96992b9f6df934c9b3f5 (patch) | |
| tree | 08f28747c81473aaf77858c3770a7ddb767bcc32 /testdata | |
| parent | c27285847b7387794ed57d5c540a273d7b8331f6 (diff) | |
Add test example
Signed-off-by: Nicolas Paul <n@nc0.fr>
Diffstat (limited to 'testdata')
| -rw-r--r-- | testdata/DOMAINS.star | 49 | ||||
| -rw-r--r-- | testdata/dst/bitbucket/bar.html | 7 | ||||
| -rw-r--r-- | testdata/dst/foo.html | 7 | ||||
| -rw-r--r-- | testdata/dst/github/bar.html | 7 | ||||
| -rw-r--r-- | testdata/dst/gitiles/bar.html | 7 | ||||
| -rw-r--r-- | testdata/dst/gitlab/bar.html | 7 | ||||
| -rw-r--r-- | testdata/dst/index.html | 5 | ||||
| -rw-r--r-- | testdata/dst/sourcehut/bar.html | 7 |
8 files changed, 96 insertions, 0 deletions
diff --git a/testdata/DOMAINS.star b/testdata/DOMAINS.star new file mode 100644 index 0000000..5f3946a --- /dev/null +++ b/testdata/DOMAINS.star @@ -0,0 +1,49 @@ +load("@svgu/git.star", "git") +load("@svgu/svn.star", "svn") +load("@svgu/hg.star", "hg") +load("@svgu/bzr.star", "bzr") +load("@svgu/fossil.star", "fossil") + +index(domain = "example.com") + +module( + name = "foo", + vcs = git.GIT, + repo = "https://example.com", + dir = "https://example.com{/dir}", + file = "https://example.com{/dir}/{file}", +) + +git.github( + name = "github/bar", + user = "example", + repo = "bar.git", +) + +git.gitlab( + name = "gitlab/bar", + user = "example", + repo = "bar.git", +) + +git.sourcehut( + name = "sourcehut/bar", + user = "example", + repo = "bar.git", + ref = "trunk", +) + +git.bitbucket( + name = "bitbucket/bar", + workspace = "example", + repo = "bar.git", + ref = "default", + instance = "https://root@bitbucket.org", +) + +git.gitiles( + name = "gitiles/bar", + repo = "example/bar.git", + ref = "master", + instance = "https://gerrit.googlesource.com", +) diff --git a/testdata/dst/bitbucket/bar.html b/testdata/dst/bitbucket/bar.html new file mode 100644 index 0000000..94057c0 --- /dev/null +++ b/testdata/dst/bitbucket/bar.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/bitbucket/bar git https://root@bitbucket.org/example/bar.git" name="go-import"> +<meta content="example.com/bitbucket/bar https://root@bitbucket.org/example/bar.git https://root@bitbucket.org/example/bar.git/src/default{/dir} https://root@bitbucket.org/example/bar.git/src/default{/dir}/{file}#{file}-{line}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/bitbucket/bar">here</a>.
\ No newline at end of file diff --git a/testdata/dst/foo.html b/testdata/dst/foo.html new file mode 100644 index 0000000..4b727d7 --- /dev/null +++ b/testdata/dst/foo.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/foo git https://example.com" name="go-import"> +<meta content="example.com/foo https://example.com https://example.com{/dir} https://example.com{/dir}/{file}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/foo">here</a>.
\ No newline at end of file diff --git a/testdata/dst/github/bar.html b/testdata/dst/github/bar.html new file mode 100644 index 0000000..70cbeaf --- /dev/null +++ b/testdata/dst/github/bar.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/github/bar git https://github.com/example/bar.git" name="go-import"> +<meta content="example.com/github/bar https://github.com/example/bar.git https://github.com/example/bar.git/tree/main{/dir} https://github.com/example/bar.git/blob/main{/dir}/{file}#L{line}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/github/bar">here</a>.
\ No newline at end of file diff --git a/testdata/dst/gitiles/bar.html b/testdata/dst/gitiles/bar.html new file mode 100644 index 0000000..a9ce377 --- /dev/null +++ b/testdata/dst/gitiles/bar.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/gitiles/bar git https://gerrit.googlesource.com/example/bar.git" name="go-import"> +<meta content="example.com/gitiles/bar https://gerrit.googlesource.com/example/bar.git https://gerrit.googlesource.com/example/bar.git/+/refs/heads/master{/dir} https://gerrit.googlesource.com/example/bar.git/+/refs/heads/master{/dir}/{file}#{line}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/gitiles/bar">here</a>.
\ No newline at end of file diff --git a/testdata/dst/gitlab/bar.html b/testdata/dst/gitlab/bar.html new file mode 100644 index 0000000..67b8815 --- /dev/null +++ b/testdata/dst/gitlab/bar.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/gitlab/bar git https://gitlab.com/example/bar.git" name="go-import"> +<meta content="example.com/gitlab/bar https://gitlab.com/example/bar.git https://gitlab.com/example/bar.git/-/tree/main{/dir} https://gitlab.com/example/bar.git/-/blob/main{/dir}/{file}#L{line}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/gitlab/bar">here</a>.
\ No newline at end of file diff --git a/testdata/dst/index.html b/testdata/dst/index.html new file mode 100644 index 0000000..c05f8d8 --- /dev/null +++ b/testdata/dst/index.html @@ -0,0 +1,5 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="2; url='https://pkg.go.dev'" http-equiv="refresh"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>Nothing to see, redirecting <a href="https://pkg.go.dev">here</a>.
\ No newline at end of file diff --git a/testdata/dst/sourcehut/bar.html b/testdata/dst/sourcehut/bar.html new file mode 100644 index 0000000..ec3bb2a --- /dev/null +++ b/testdata/dst/sourcehut/bar.html @@ -0,0 +1,7 @@ +<!DOCTYPE html> +<meta charset="UTF-8"> +<meta content="example.com/sourcehut/bar git https://git.sr.ht/~example/bar.git" name="go-import"> +<meta content="example.com/sourcehut/bar https://git.sr.ht/~example/bar.git https://git.sr.ht/~example/bar.git/tree/trunk{/dir} https://git.sr.ht/~example/bar.git/tree/trunk/item{/dir}/{file}#L{line}" + name="go-source"> +<meta content="width=device-width,initial-scale=1" name="viewport"> +<p>There is nothing to see, redirecting <a href="https://pkg.go.dev/example.com/sourcehut/bar">here</a>.
\ No newline at end of file |
