Compare commits
2 Commits
57b2d182c7
...
cddf81e6a5
| Author | SHA1 | Date | |
|---|---|---|---|
| cddf81e6a5 | |||
| 35dc998b03 |
+2
-1
@@ -53,7 +53,8 @@ replacement, and each removed path, column or flag.
|
||||
ranges the SSA assigns and carries the columns `area`, `group` and `serial`, so
|
||||
`--format csv en_US.ssn` writes a header where it used to fail; `en_US.itin` is new
|
||||
and carries the same three. `person.prefix` is null where a person has no title,
|
||||
where it used to be an empty string, so `--format sql` writes `NULL`.
|
||||
where it used to be an empty string, so `--format sql` writes `NULL` and a `string`
|
||||
struct field reading it becomes `*string`.
|
||||
- `ErrNoColumns` is exported, so a caller can tell the one record fence a path can
|
||||
answer from the rest.
|
||||
- An error names a spelling that runs: a layout is named single-quoted and free of
|
||||
|
||||
@@ -798,7 +798,9 @@ App developers writing tests and fixtures, in Go and at a shell:
|
||||
library's own advice reachable: the error for an object holding only a format
|
||||
names `"…"`, and that spelling has to work where it is printed. An argument or struct
|
||||
tag of one reference alone, `{/users}`, is refused naming the path `users`: both
|
||||
render the same text, and only the path names a record. `IsTemplate` exports the
|
||||
render the same text, and only the path names a record. A folder-relative `{.name}`
|
||||
or `{..name}` is refused naming `{/name}`, since an inline template sits in no
|
||||
folder. `IsTemplate` exports the
|
||||
rule, so the CLI, struct tags and any other caller read one.
|
||||
- **An inline template skips the cycle fence.** `New` proves the loaded tree
|
||||
acyclic, an inline node is a finite tree of its own, and nothing in the tree can
|
||||
|
||||
@@ -621,3 +621,21 @@ func TestRunNumbersFollowTheShell(t *testing.T) {
|
||||
t.Errorf("run(--seed 007 --repeat +3) = %d, %q, stderr %q; want the same as --seed 7 --repeat 3 %q", code, got, errb, want)
|
||||
}
|
||||
}
|
||||
|
||||
// TestRunRecordOfAFieldlessPath pins the way out of asking a category of one value
|
||||
// for columns: the record to write, and the quoting a shell needs to take it. The
|
||||
// argument is well-formed and only the data cannot serve it, so the code is 1.
|
||||
func TestRunRecordOfAFieldlessPath(t *testing.T) {
|
||||
code, out, errb := runOut("--format", "csv", "sv_SE.personnummer")
|
||||
if code != 1 {
|
||||
t.Fatalf("run(--format csv sv_SE.personnummer) = %d, want 1", code)
|
||||
}
|
||||
for _, want := range []string{`{"format":"","personnummer":"{/sv_SE.personnummer}"}`, "single quotes"} {
|
||||
if !strings.Contains(errb, want) {
|
||||
t.Errorf("stderr = %q, want it to name %s", errb, want)
|
||||
}
|
||||
}
|
||||
if out != "" {
|
||||
t.Errorf("stdout = %q, want nothing", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user