MCPcopy Create free account
hub / github.com/devld/go-drive / TestShellThumbnailMultilineScript

Function TestShellThumbnailMultilineScript

server/thumbnail/shell_test.go:9–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

7)
8
9func TestShellThumbnailMultilineScript(t *testing.T) {
10 script := "printf first\nprintf second"
11 handler, e := newShellThumbnailTypeHandler(types.SM{
12 "shell": script,
13 "mime-type": "image/jpeg",
14 })
15 if e != nil {
16 t.Fatal(e)
17 }
18 shellHandler := handler.(*shellThumbnailTypeHandler)
19 wantCommand, wantArgs := platformShellCommand("linux", script)
20 if shellHandler.command != wantCommand {
21 t.Skip("test assertions target the Unix test environment")
22 }
23 if !reflect.DeepEqual(shellHandler.args, wantArgs) {
24 t.Fatalf("unexpected arguments: %#v", shellHandler.args)
25 }
26}
27
28func TestPlatformShellCommand(t *testing.T) {
29 tests := []struct {

Callers

nothing calls this directly

Calls 3

platformShellCommandFunction · 0.85
SkipMethod · 0.80

Tested by

no test coverage detected