v0.27.0 packaging update
This commit is contained in:
1 parent
b5ac9084c7
commit
60abc97eb0
17 files changed
+1194
-43
No files matched your search
+24
-12
@@ -136,18 +136,7 @@ func TestHelpAndManualListEveryOption(t *testing.T) {
|
||||
}
|
||||
var help bytes.Buffer
|
||||
printHelp(&help)
|
||||
options := map[string]string{} // long -> its short, if lw takes one
|
||||
for _, long := range config.SpecFlags() {
|
||||
options[long] = ""
|
||||
}
|
||||
for long := range config.Settings() {
|
||||
options[long] = ""
|
||||
}
|
||||
for letter, short := range shorts {
|
||||
if short.top {
|
||||
options[short.long] = letter
|
||||
}
|
||||
}
|
||||
options := options()
|
||||
// mdoc's Fl writes the first dash, and the others as \-
|
||||
fl := func(flag string) string { return regexp.QuoteMeta("Fl " + strings.ReplaceAll(flag[1:], "-", `\-`)) }
|
||||
for long, letter := range options {
|
||||
@@ -271,3 +260,26 @@ func TestTLSCommandsIssueAVerifiableChain(t *testing.T) {
|
||||
t.Fatalf("second ca: exit %d: %s", code, stderr)
|
||||
}
|
||||
}
|
||||
|
||||
var update = flag.Bool("update", false, "rewrite the completion scripts: make completion")
|
||||
|
||||
// The installed completion scripts are what lw's tables generate
|
||||
func TestCompletionScriptsAreCurrent(t *testing.T) {
|
||||
for _, sh := range shells {
|
||||
script := sh.script()
|
||||
path := filepath.Join("../../deploy/package/completion", sh.file)
|
||||
if *update {
|
||||
if err := os.WriteFile(path, script, 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
have, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !bytes.Equal(have, script) {
|
||||
t.Errorf("%s is not what lw's tables generate: run make completion", path)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user