From 571e4f2ae10d06addd0868f1ac474cc2055fbcb6 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Fri, 28 Jul 2017 09:32:37 -0600 Subject: Fixing issue with compliance export encoding (#7042) --- model/compliance_post_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'model/compliance_post_test.go') diff --git a/model/compliance_post_test.go b/model/compliance_post_test.go index 4866b2494..ff159ef1b 100644 --- a/model/compliance_post_test.go +++ b/model/compliance_post_test.go @@ -25,3 +25,26 @@ func TestCompliancePost(t *testing.T) { t.Fatal() } } + +var cleanTests = []struct { + in string + expected string +}{ + {"hello", "hello"}, + {"=hello", "'=hello"}, + {"+hello", "'+hello"}, + {"-hello", "'-hello"}, + {" =hello", "' =hello"}, + {" +hello", "' +hello"}, + {" -hello", "' -hello"}, + {"\t -hello", "'\t -hello"}, +} + +func TestCleanComplianceStrings(t *testing.T) { + for _, tt := range cleanTests { + actual := cleanComplianceStrings(tt.in) + if actual != tt.expected { + t.Errorf("cleanComplianceStrings(%v): expected %v, actual %v", tt.in, tt.expected, actual) + } + } +} -- cgit v1.2.3-1-g7c22