From 575f2c04a5b43aaa5738b63fc13e71d3e12c7d78 Mon Sep 17 00:00:00 2001 From: Seebs Date: Thu, 10 Nov 2022 14:18:30 -0600 Subject: [PATCH] drop invalid UTF8 encoding from encoding tests Testing unicode is great, but we appear to have had a couple of cases where we were using strings that weren't valid UTF8. Weirdly, other instances of these strings work -- I think because they're in raw quotes (backticks) rather than strings. Anyway, this is what SonarCloud fusses about. (cherry picked from commit ab543adbe3b51dab634b52e369a780e976a78b0e) --- idk/kafka_sasl/cmd_test.go | 2 +- idk/kafka_static/cmd_test.go | 2 +- pql/pqlpeg_test.go | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/idk/kafka_sasl/cmd_test.go b/idk/kafka_sasl/cmd_test.go index daa24dae7..7314f1740 100644 --- a/idk/kafka_sasl/cmd_test.go +++ b/idk/kafka_sasl/cmd_test.go @@ -419,7 +419,7 @@ func TestSaslLookupFieldWithExternalId(t *testing.T) { // - identifying duplicates is not possible without a primary key in the message {name: "missing-data", missing: true}, {name: "normal-write", text: "D", expText: "D"}, - {name: "weirdstring-1", text: "Æ�漢д ☮♬ ♞🜻💣", expText: "Æ�漢д ☮♬ ♞🜻💣"}, + {name: "weirdstring-1", text: "Æ漢д ☮♬ ♞🜻💣", expText: "Æ漢д ☮♬ ♞🜻💣"}, {name: "weirdstring-2", text: "", expText: ""}, {name: "weirdstring-3", text: "'", expText: "'"}, {name: "doublequotes-1", text: `\"`, expText: `"`}, // is this sensible? diff --git a/idk/kafka_static/cmd_test.go b/idk/kafka_static/cmd_test.go index 4f4d9ae55..cc4d06bc8 100644 --- a/idk/kafka_static/cmd_test.go +++ b/idk/kafka_static/cmd_test.go @@ -291,7 +291,7 @@ func TestLookupFieldWithExternalId(t *testing.T) { // - identifying duplicates is not possible without a primary key in the message {name: "missing-data", missing: true}, {name: "normal-write", text: "D", expText: "D"}, - {name: "weirdstring-1", text: "Æ�漢д ☮♬ ♞🜻💣", expText: "Æ�漢д ☮♬ ♞🜻💣"}, + {name: "weirdstring-1", text: "Æ漢д ☮♬ ♞🜻💣", expText: "Æ漢д ☮♬ ♞🜻💣"}, {name: "weirdstring-2", text: "", expText: ""}, {name: "weirdstring-3", text: "'", expText: "'"}, {name: "doublequotes-1", text: `\"`, expText: `"`}, // is this sensible? diff --git a/pql/pqlpeg_test.go b/pql/pqlpeg_test.go index 3c39b451a..93fecba9f 100644 --- a/pql/pqlpeg_test.go +++ b/pql/pqlpeg_test.go @@ -344,21 +344,21 @@ func TestPQLDeepEquality(t *testing.T) { }}, { name: "SetWithUnicode", - call: `Set(0, unicode="Æ�漢д ☮♬ ♞🜻💣")`, + call: `Set(0, unicode="Æ漢д ☮♬ ♞🜻💣")`, exp: &Call{ Name: "Set", Args: map[string]interface{}{ "_col": int64(0), - "unicode": `Æ�漢д ☮♬ ♞🜻💣`, + "unicode": `Æ漢д ☮♬ ♞🜻💣`, }, }}, { name: "RowWithUnicode", - call: `Row(unicode="Æ�漢д ☮♬ ♞🜻💣")`, + call: `Row(unicode="Æ漢д ☮♬ ♞🜻💣")`, exp: &Call{ Name: "Row", Args: map[string]interface{}{ - "unicode": `Æ�漢д ☮♬ ♞🜻💣`, + "unicode": `Æ漢д ☮♬ ♞🜻💣`, }, }}, { @@ -373,7 +373,7 @@ func TestPQLDeepEquality(t *testing.T) { }}, { name: "TopNWithUnicode", - call: `TopN(stargazer, Row(unicode="Æ�漢д ☮♬ ♞🜻💣"), a="∑")`, + call: `TopN(stargazer, Row(unicode="Æ漢д ☮♬ ♞🜻💣"), a="∑")`, exp: &Call{ Name: "TopN", Args: map[string]interface{}{ @@ -381,7 +381,7 @@ func TestPQLDeepEquality(t *testing.T) { "a": "∑", }, Children: []*Call{ - {Name: "Row", Args: map[string]interface{}{"unicode": "Æ�漢д ☮♬ ♞🜻💣"}}, + {Name: "Row", Args: map[string]interface{}{"unicode": "Æ漢д ☮♬ ♞🜻💣"}}, }, }}, {