Skip to content

Commit

Permalink
first test
Browse files Browse the repository at this point in the history
  • Loading branch information
Selyss committed Nov 22, 2023
1 parent 7f0e5a7 commit 3dd3b2d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions pkg/assembuddy/requestTable_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package assembuddy

import (
"reflect"
"testing"
)

func TestGetSyscallData(t *testing.T) {
opts := CLIOptions{
Syscall: "read",
Arch: "x64",
ListArch: false,
PrettyPrint: false,
}

want := []Syscall{}

syscall := Syscall{
Arch: "x64",
Name: "read",
ReturnValue: "0x00",
Arg0: "unsigned int fd",
Arg1: "char *buf",
Arg2: "size_t count",
Arg3: "",
Arg4: "",
Arg5: "",
}

want = append(want, syscall)

got, err := GetSyscallData(&opts)
if !(reflect.DeepEqual(want, got)) || err != nil {
t.Errorf("Expected opts to parse correctly %v", err)
}
}

0 comments on commit 3dd3b2d

Please sign in to comment.