{"record":{"id":"0b23e7ac19236039","repo":"kovidgoyal/kitty","slug":"s-is-not-a-valid-test-number","errorCode":null,"errorMessage":"%s is not a valid test number","messagePattern":"(.+?) is not a valid test number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/cli/wcswidth_kitten.go","lineNumber":262,"sourceCode":"\t\treturn 1, err\n\t}\n\treturn\n}\n\nfunc WcswidthKittenEntryPoint(root *Command) {\n\troot.AddSubCommand(&Command{\n\t\tName:            \"__width_test__\",\n\t\tUsage:           \"[test number to run...]\",\n\t\tHelpText:        \"Test the terminal for compliance with the kitty text-sizing specification's splitting of text into cells. You can optionally specify specific test numbers to run.\",\n\t\tHidden:          true,\n\t\tOnlyArgsAllowed: true,\n\t\tRun: func(cmd *Command, args []string) (rc int, err error) {\n\t\t\tallowed_tests := utils.NewSet[int]()\n\t\t\tfor _, arg := range args {\n\t\t\t\tif x, err := strconv.Atoi(arg); err == nil {\n\t\t\t\t\tallowed_tests.Add(x)\n\t\t\t\t} else {\n\t\t\t\t\treturn 1, fmt.Errorf(\"%s is not a valid test number\", arg)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn main(allowed_tests)\n\t\t},\n\t})\n}\n","sourceCodeStart":244,"sourceCodeEnd":269,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/cli/wcswidth_kitten.go#L244-L269","documentation":"The wcswidth kitten accepts optional test numbers on its command line; one of the arguments could not be parsed as an integer. The kitten rejects the whole invocation before running anything.","triggerScenarios":"Passing a non-numeric argument, e.g. 'kitty +kitten wcswidth foo' or '1-5' or '1,2' — only bare integers like '3' are accepted.","commonSituations":"Users trying to pass ranges or comma-separated lists of tests, or misspelling/adding flags the kitten does not support.","solutions":["Pass only space-separated integer test numbers, e.g. 'kitty +kitten wcswidth 3 7 12'","Do not use ranges or commas; expand them yourself","Run with no arguments to execute all tests"],"exampleFix":"// before\nkitty +kitten wcswidth 1-5\n// after\nkitty +kitten wcswidth 1 2 3 4 5","handlingStrategy":"validation","validationCode":"for _, a := range args {\n    if _, err := strconv.Atoi(a); err != nil {\n        return fmt.Errorf(\"%s is not a valid test number\", a)\n    }\n}","typeGuard":"func isTestNumber(s string) bool { _, err := strconv.Atoi(s); return err == nil }","tryCatchPattern":null,"preventionTips":["Pass only space-separated integers","Expand ranges before invoking the kitten"],"tags":["kitty","cli","argument-validation"],"backgroundTag":"invalid-cli-argument","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}