Fix creating filesystem structure

This commit is contained in:
Ian Adam Naval 2014-10-16 19:02:02 -04:00
parent af72e66f8b
commit 6f5f3d6407
2 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ func NewFilesystem(args []string) (procPtr *Filesystem, err error) {
// TODO: add error checking
size, _ := strconv.Atoi(args[1])
used, _ := strconv.Atoi(args[2])
available, _ := strconv.Atoi(args[2])
available, _ := strconv.Atoi(args[3])
procPtr = &Filesystem{
args[0], size, used, available, args[4]}
}

View File

@ -20,7 +20,7 @@ func TestNewFilesystem(t *testing.T) {
if err != nil {
t.Errorf("Passing 5 strings should not raise an error")
}
expected := Filesystem{"1", "2", "3", "4", "5"}
expected := Filesystem{"1", 2, 3, 4, "5"}
actual := *proc
if expected != actual {
t.Errorf("Filesystem was incorrectly generated:\n%s != %s", expected, actual)