Skip to content

Commit

Permalink
Add: new processor escape quote and fix test cases text
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyu003 committed Apr 19, 2024
1 parent 609c776 commit 7b6f4de
Show file tree
Hide file tree
Showing 22 changed files with 304 additions and 50 deletions.
62 changes: 62 additions & 0 deletions cmd/processor_escape-quotes.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions processors/ascii85_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestAscii85Encoding_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestAscii85Decoding_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
4 changes: 2 additions & 2 deletions processors/base32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestBase32Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -106,7 +106,7 @@ func TestBase32Decode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
4 changes: 2 additions & 2 deletions processors/base64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestBase64Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestBase64Decode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
4 changes: 2 additions & 2 deletions processors/base64url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestBase64URLEncode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -127,7 +127,7 @@ func TestBase64URLDecode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
14 changes: 7 additions & 7 deletions processors/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestMD5Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -136,7 +136,7 @@ func TestSHA1Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -217,7 +217,7 @@ func TestSHA256Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -298,7 +298,7 @@ func TestSHA224Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -379,7 +379,7 @@ func TestSHA384Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -460,7 +460,7 @@ func TestSHA512Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -549,7 +549,7 @@ func TestBcrypt_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/emails_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestExtractEmails_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
4 changes: 2 additions & 2 deletions processors/hex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestHexEncode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -115,7 +115,7 @@ func TestHexDecode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
4 changes: 2 additions & 2 deletions processors/html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestHTMLEncode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestHTMLDecode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestExtractIPs_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
10 changes: 5 additions & 5 deletions processors/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestJSON_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestJSONToMSGPACK_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -251,7 +251,7 @@ func TestMSGPACKToJSON_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -347,7 +347,7 @@ func TestJSONUnescape_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -479,7 +479,7 @@ func TestJSONEscape_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
10 changes: 5 additions & 5 deletions processors/lines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestCountLines_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -117,7 +117,7 @@ func TestShuffleLines_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestSortLines_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -258,7 +258,7 @@ func TestUniqueLines_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down Expand Up @@ -345,7 +345,7 @@ func TestReverseLines_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestMarkdown_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/morse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestMorseCodeEncode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
1 change: 1 addition & 0 deletions processors/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var List = []list.Item{
CountCharacters{},
CountLines{},
CountWords{},
EscapeQuotes{},
ExtractEmails{},
ExtractIPs{},
FormatJSON{},
Expand Down
2 changes: 1 addition & 1 deletion processors/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestZeropad_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/rgb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func TestRGB_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
2 changes: 1 addition & 1 deletion processors/rot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestROT13Encode_Command(t *testing.T) {
t.Errorf("Description() = %v, want %v", got, test.description)
}
if got := p.FilterValue(); got != test.filterValue {
t.Errorf("Flags() = %v, want %v", got, test.filterValue)
t.Errorf("FilterValue() = %v, want %v", got, test.filterValue)
}
if got := p.Flags(); !reflect.DeepEqual(got, test.flags) {
t.Errorf("Flags() = %v, want %v", got, test.flags)
Expand Down
Loading

0 comments on commit 7b6f4de

Please sign in to comment.