Want a lone reference whose selector holds a parenthesis refused as a template, and drop the parse test's stale order note
This commit is contained in:
@@ -96,8 +96,6 @@ func TestCalcReproducible(t *testing.T) {
|
||||
|
||||
// TestParsedCallReadsOnlyAnOperandBuiltin pins the operands a parsed call carries for a
|
||||
// call that is not a calc, and for one whose expression does not parse: none, either way.
|
||||
// checkCalc is what reports a bad expression, so the callers that run after it
|
||||
// never meet one — but they must not have to depend on that order to be safe.
|
||||
func TestParsedCallReadsOnlyAnOperandBuiltin(t *testing.T) {
|
||||
for _, format := range []string{"{luhn()}", "{calc()}", "{calc(1 +)}", "{calc(()}"} {
|
||||
if toks, err := parseFormat(format); err != nil || len(toks) != 1 || toks[0].names != nil {
|
||||
|
||||
@@ -193,6 +193,7 @@ func TestIsTemplate(t *testing.T) {
|
||||
"{//sv_SE.person}": "{//sv_SE.person} is the path sv_SE.person written as a template; write sv_SE.person",
|
||||
"/sv_SE/person": `path "sv_SE/person" contains "/"`,
|
||||
"{/-}": `path "-" is reserved`,
|
||||
"{/misc.currency[US Dollar (Next day)]}": "write misc.currency[US Dollar (Next day)]",
|
||||
} {
|
||||
if _, err := IsTemplate(arg); err == nil || !strings.Contains(err.Error(), want) {
|
||||
t.Errorf("IsTemplate(%q) = %v; want it rejected naming %s", arg, err, want)
|
||||
|
||||
Reference in New Issue
Block a user