Skip to content

Commit

Permalink
wip: test for cli
Browse files Browse the repository at this point in the history
  • Loading branch information
amitsaha committed Aug 24, 2023
1 parent 3e3af2e commit 466f6e1
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cli_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main

import (
"os"
"os/exec"
"testing"
)

func TestCli(t *testing.T) {
cmd := exec.Command("go", "build", "-o", "gitbackup_test_bin")
stdoutStderr, err := cmd.CombinedOutput()
if err != nil {
t.Fatal(err)
}
defer func() {
err := os.Remove("gitbackup_test_bin")
if err != nil {
t.Fatal(err)
}
}()
cmd = exec.Command("./gitbackup_test_bin", "-h")
stdoutStderr, err = cmd.CombinedOutput()
if err != nil {
t.Fatal(err)
}
t.Log(string(stdoutStderr))
}

0 comments on commit 466f6e1

Please sign in to comment.