diff options
Diffstat (limited to 'model/compliance_post_test.go')
-rw-r--r-- | model/compliance_post_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
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) + } + } +} |