Skip to content

Commit

Permalink
removed containStr
Browse files Browse the repository at this point in the history
  • Loading branch information
LbP22 committed Apr 22, 2024
1 parent 437a7a7 commit 904999a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
8 changes: 0 additions & 8 deletions application/backend/app/containerdb/containerdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ import (
"github.com/syndtr/goleveldb/leveldb/iterator"
)

func containStr(a string, b string, caseSens bool) bool {
if caseSens {
return strings.Contains(a, b)
}

return strings.Contains(strings.ToLower(a), strings.ToLower(b))
}

func PutLogMessage(db *leveldb.DB, host string, container string, message_item []string) error {
if len(message_item[0]) < 30 {
fmt.Println("WARNING: got broken timestamp: ", "timestamp: "+message_item[0], "message: "+message_item[1])
Expand Down
25 changes: 0 additions & 25 deletions application/backend/app/containerdb/containerdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,6 @@ import (
"github.com/syndtr/goleveldb/leveldb"
)

func Test_containStr(t *testing.T) {
type args struct {
a string
b string
caseSens bool
}
tests := []struct {
name string
args args
want bool
}{
{"Not contain", args{a: "Amogus", b: "sus", caseSens: false}, false},
{"Contain without caseSens", args{a: "Amogus", b: "O", caseSens: false}, true},
{"Contain, but caseSens", args{a: "Amogus", b: "O", caseSens: true}, false},
{"Contain", args{a: "Amogus", b: "o", caseSens: true}, true},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := containStr(tt.args.a, tt.args.b, tt.args.caseSens); got != tt.want {
t.Errorf("containStr() = %v, want %v", got, tt.want)
}
})
}
}

func TestPutLogMessage(t *testing.T) {
cont := "testCont"
host := "testHost"
Expand Down

0 comments on commit 904999a

Please sign in to comment.