Skip to content

Commit

Permalink
Updated test to work with new API.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkw31 committed Oct 22, 2024
1 parent 9135252 commit ac2aade
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,15 @@ func TestDB(t *testing.T) {
"moduleB,userB,2,1,5\n",
},
} {
if err := db.Add(test.Username, test.Command, test.Module, test.IP.String(), test.Time); err != nil {
if err := db.AddOther(test.Username, test.Command, test.Module, test.IP.String(), test.Time.Unix()); err != nil {
t.Errorf("test %d: unexpected error adding event: %s", n+1, err)

continue
}

if evtable := dumpTable(t, db, "events"); evtable != test.ExpectedEvents {
t.Errorf("test %d: expected events table to be:\n%s\ngot:\n%s", n+1, test.ExpectedEvents, evtable)
} else if mdtable := dumpTable(t, db, "modules"); mdtable != test.ExpectedModules {
t.Errorf("test %d: expected modules table to be:\n%s\ngot:\n%s", n+1, test.ExpectedModules, mdtable)
} else if umtable := dumpTable(t, db, "usermodules"); umtable != test.ExpectedUserModules {
} else if umtable := dumpTable(t, db, "othermodules"); umtable != test.ExpectedUserModules {
t.Errorf("test %d: expected usermodules table to be:\n%s\ngot:\n%s", n+1, test.ExpectedUserModules, umtable)
}
}
Expand Down

0 comments on commit ac2aade

Please sign in to comment.