Test the table node: rows TSV, key and name selection, linked tables drawn consistently, and the choice-of-rows fence

This commit is contained in:
2026-09-17 11:47:39 +02:00
parent 06a93bb96d
commit d4060e041a
12 changed files with 671 additions and 24 deletions
+3 -3
View File
@@ -52,8 +52,8 @@ type structLink struct {
func structData(t *testing.T) *Generator {
t.Helper()
return newGenerator(t, writeData(t, map[string]string{
"person": `[{"format":"{first} {last}","first":"Ada","last":"Lovelace"},{"format":"{first} {last}","first":"Bo","last":"Ek"}]`,
"place": `[{"format":"{city}","city":"Stockholm","zip":"111 22"},{"format":"{city}","city":"Tranås","zip":"573 31"}]`,
"person": `[{"format":"{first} {last}","first":"Ada","last":"Lovelace"},{"format":"{first} {last}","first":"Bo","last":"Ek","born":"1815"}]`,
"place": `[{"format":"{city}","city":"Stockholm","zip":"111 22"},{"format":"{city}","city":"Tranås","zip":"573 31","region":"F"}]`,
"mid": `{"format":"","score":["{/src.score}",{"format":"5","datatype":"integer"}]}`,
"src": `{"format":"","code":[null,"200","404"],"del":null,"score":[null,{"format":"{int(1,9)}","datatype":"integer"}]}`,
"trip": `{"format":"","leg":[{"format":"{to}","to":"Oslo"},{"format":"{to}","to":"Rome"}]}`,
@@ -275,7 +275,7 @@ func TestFakeStructErrors(t *testing.T) {
}{}, "is empty"},
{&struct {
A string `fake:"[abc]"`
}{}, `holds a "["`},
}{}, `"["`},
{&struct {
A string `fake:"{.person.first} x"`
}{}, "write {/person.first}"},