This repository has been archived on 2015-04-29. You can view files and clone it, but cannot push or open issues or pull requests.
jsh/filesystem_test.go
Ian Adam Naval e2ed6a4111 Add df
2014-10-14 16:32:08 -04:00

29 lines
742 B
Go

package jsh
import "testing"
func TestNewFilesystem(t *testing.T) {
tooManyArgs := []string{"1", "2", "3", "4"}
_, err := NewFilesystem(tooManyArgs)
if err == nil {
t.Errorf("Passing 4 strings should raise an error")
}
tooFewArgs := []string{"1", "2", "3", "4", "5", "6"}
_, err = NewFilesystem(tooFewArgs)
if err == nil {
t.Errorf("Passing 6 strings should raise an error")
}
justRightArgs := []string{"1", "2", "3", "4", "5"}
proc, err := NewFilesystem(justRightArgs)
if err != nil {
t.Errorf("Passing 5 strings should not raise an error")
}
expected := Filesystem{"1", "2", "3", "4", "5"}
actual := *proc
if expected != actual {
t.Errorf("Filesystem was incorrectly generated:\n%s != %s", expected, actual)
}
}