vole
Site
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software/vole.git
Self-hosted forge that lives in your Git repo.
| 1 | //go:build !windows |
| 2 | |
| 3 | package main |
| 4 | |
| 5 | import ( |
| 6 | "strings" |
| 7 | "testing" |
| 8 | ) |
| 9 | |
| 10 | // TestServiceIsWindowsOnly pins the answer a unix user gets. The verbs are in the |
| 11 | // command table everywhere so the generated reference does not depend on the |
| 12 | // platform that built the binary, but the service manager is Windows's business. |
| 13 | func TestServiceIsWindowsOnly(t *testing.T) { |
| 14 | err := cmdService([]string{"status"}) |
| 15 | if err == nil { |
| 16 | t.Fatal("vole service status succeeded outside Windows") |
| 17 | } |
| 18 | if !strings.Contains(err.Error(), "Windows") { |
| 19 | t.Fatalf("the error does not say the command is Windows-only: %v", err) |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | // TestServiceRejectsFlagsTheSubcommandDoesNotTake keeps the shared decode table |
| 24 | // honest: `service status` reads no options, so a config path is a mistake |
| 25 | // rather than something to ignore. |
| 26 | func TestServiceRejectsFlagsTheSubcommandDoesNotTake(t *testing.T) { |
| 27 | if err := cmdService([]string{"status", "--config", "vole.toml"}); err == nil { |
| 28 | t.Fatal("service status accepted --config") |
| 29 | } |
| 30 | } |
| 31 |