mirror of
https://github.com/wahyd4/forego.git
synced 2026-08-09 05:07:05 +10:00
21 lines
325 B
Go
21 lines
325 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
)
|
|
|
|
func TestVersion(t *testing.T) {
|
|
var b bytes.Buffer
|
|
stdout = &b
|
|
cmdVersion.Run(cmdVersion, []string{})
|
|
output := b.String()
|
|
assertEqual(t, output, "dev\n")
|
|
}
|
|
|
|
func assertEqual(t *testing.T, a, b interface{}) {
|
|
if a != b {
|
|
t.Fatalf(`Expected %#v to equal %#v`, a, b)
|
|
}
|
|
}
|