(t *testing.T)
| 48 | } |
| 49 | |
| 50 | func TestInterfaceMethods(t *testing.T) { |
| 51 | // Test Get |
| 52 | a := data1.Get(1) |
| 53 | if a != -10.001 { |
| 54 | t.Errorf("Get(2) => %.1f != %.1f", a, -10.001) |
| 55 | } |
| 56 | |
| 57 | // Test Len |
| 58 | l := data1.Len() |
| 59 | if l != 8 { |
| 60 | t.Errorf("Len() => %v != %v", l, 8) |
| 61 | } |
| 62 | |
| 63 | // Test Less |
| 64 | b := data1.Less(0, 5) |
| 65 | if !b { |
| 66 | t.Errorf("Less() => %v != %v", b, true) |
| 67 | } |
| 68 | |
| 69 | // Test Swap |
| 70 | data1.Swap(0, 2) |
| 71 | if data1.Get(0) != 5 { |
| 72 | t.Errorf("Len() => %v != %v", l, 8) |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | func TestHelperMethods(t *testing.T) { |
| 77 |