MCPcopy Index your code
hub / github.com/aarondl/sqlboiler / TestBinaryDriver

Function TestBinaryDriver

drivers/binary_driver_test.go:24–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22`
23
24func TestBinaryDriver(t *testing.T) {
25 if runtime.GOOS == "windows" {
26 t.Skip("cannot run binary test on windows (needs bin/sh)")
27 }
28
29 var want, got *DBInfo
30 if err := json.Unmarshal([]byte(testBinaryJSON), &want); err != nil {
31 t.Fatal(err)
32 }
33
34 bin, err := os.CreateTemp("", "test_binary_driver")
35 if err != nil {
36 t.Fatal(err)
37 }
38 fmt.Fprint(bin, testBinaryDriver)
39 if err := bin.Chmod(0774); err != nil {
40 t.Fatal(err)
41 }
42 if err := bin.Close(); err != nil {
43 t.Fatal(err)
44 }
45
46 name := bin.Name()
47
48 exe := binaryDriver(name)
49 got, err = exe.Assemble(nil)
50 if err != nil {
51 t.Fatal(err)
52 }
53
54 if !reflect.DeepEqual(want, got) {
55 t.Errorf("want:\n%#v\ngot:\n%#v\n", want, got)
56 }
57}
58
59func TestBinaryWarningDriver(t *testing.T) {
60 if runtime.GOOS == "windows" {

Callers

nothing calls this directly

Calls 4

binaryDriverTypeAlias · 0.85
UnmarshalMethod · 0.80
AssembleMethod · 0.65
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…