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.
17 lines
421 B
17 lines
421 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")
|
|
|
|
// This fails because flag can't be run more than once
|
|
args = []string{"cat.exe", "-o", "main.go"}
|
|
opts = ParseOpts(args)
|
|
assert.Equal(t, opts.Octal, true, "-o didn't work")
|
|
}
|
|
|