This is an education project that attempts to reimplement the GNU coreutils in Go. You can find the full manual here: https://www.gnu.org/software/coreutils/manual/coreutils.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
go-coreutils/tested/od/od_test.go

18 lines
404 B

package main
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestParseOpts(t *testing.T) {
args := []string{"od.exe", "-x", "main.go"}
opts := ParseOpts(args)
assert.Equal(t, opts.Hex, true, "-x didn't work")
// now we can test as much as we want
args = []string{"cat.exe", "-o", "main.go"}
opts = ParseOpts(args)
assert.Equal(t, opts.Octal, true, "-o didn't work")
}