Weighted person names, valid personal ids and date() in both locales #21

Merged
lilleman merged 38 commits from person-ids-date into main 2026-09-18 20:45:51 +02:00
Showing only changes of commit 2dcc31fa63 - Show all commits
+16
View File
@@ -2,6 +2,7 @@ package fejkdata
import (
"encoding/json"
"reflect"
"regexp"
"strings"
"testing"
@@ -379,3 +380,18 @@ func TestArgErrorsNameTheSpelling(t *testing.T) {
}
}
}
// TestSplitArgsQuotesOutsideSelectors pins the arg grammar: a comma splits outside a
// selector and outside a quoted layout, and a quote inside a selector is a name's text.
func TestSplitArgsQuotesOutsideSelectors(t *testing.T) {
for in, want := range map[string][]string{
"a, b": {"a", "b"},
"1990-01-01,1990-12-31,'January 2, 2006'": {"1990-01-01", "1990-12-31", "'January 2, 2006'"},
"/geo.US.locality[O'Fallon].name, 2": {"/geo.US.locality[O'Fallon].name", "2"},
"'[a,b]'": {"'[a,b]'"},
} {
if got := splitArgs(in); !reflect.DeepEqual(got, want) {
t.Errorf("splitArgs(%q) = %q, want %q", in, got, want)
}
}
}