Browse Source

Fix creating filesystem structure

Ian Adam Naval 5 years ago
parent
commit
6f5f3d6407
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      filesystem.go
  2. 1
    1
      filesystem_test.go

+ 1
- 1
filesystem.go View File

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

+ 1
- 1
filesystem_test.go View File

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

Loading…
Cancel
Save