Initial commit on Forgejo
Some checks failed
CI and releases / Test and vet (push) Failing after 1s
CI and releases / Build release binaries (push) Has been skipped
CI and releases / Publish GitHub release (push) Has been skipped

Fresh repository history for elektrine/tarakan-client hosted at
https://git.elektrine.com/elektrine/tarakan-client.
This commit is contained in:
Maxfield Luke 2026-07-29 04:56:36 -04:00
commit 58b29a7f84
70 changed files with 12994 additions and 0 deletions

View file

@ -0,0 +1,25 @@
package main
import "testing"
func TestPeelAPIFlags(t *testing.T) {
url, token, rest := peelAPIFlags([]string{
"--token", "secret", "report", "--agent", "grok", "--url", "http://localhost:4000", "--pickup",
})
if url != "http://localhost:4000" || token != "secret" {
t.Fatalf("url=%q token=%q", url, token)
}
if len(rest) != 4 || rest[0] != "report" || rest[3] != "--pickup" {
t.Fatalf("rest = %#v", rest)
}
}
func TestResolveAPIFlagURL(t *testing.T) {
got, err := resolveAPIFlagURL("", "https://tarakan.lol")
if err != nil || got != "https://tarakan.lol" {
t.Fatalf("got %q err %v", got, err)
}
if _, err := resolveAPIFlagURL("https://a", "https://b"); err == nil {
t.Fatal("expected disagreement error")
}
}