(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestTransformQuantityToAlluxioUnit(t *testing.T) { |
| 61 | testQuantity1 := resource.MustParse("10Gi") |
| 62 | testQuantity2 := resource.MustParse("10M") |
| 63 | |
| 64 | tests := []struct { |
| 65 | name string |
| 66 | quantity *resource.Quantity |
| 67 | wantValue string |
| 68 | }{ |
| 69 | { |
| 70 | name: "test1 for TransformQuantityToAlluxioUnit", |
| 71 | quantity: &testQuantity1, |
| 72 | wantValue: "10GB", |
| 73 | }, |
| 74 | { |
| 75 | name: "test2 for TransformQuantityToAlluxioUnit", |
| 76 | quantity: &testQuantity2, |
| 77 | wantValue: "10M", |
| 78 | }, |
| 79 | } |
| 80 | for _, tt := range tests { |
| 81 | t.Run(tt.name, func(t *testing.T) { |
| 82 | if gotValue := TransformQuantityToAlluxioUnit(tt.quantity); gotValue != tt.wantValue { |
| 83 | t.Errorf("TransformQuantityToAlluxioUnit() = %v, want %v", gotValue, tt.wantValue) |
| 84 | } |
| 85 | }) |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | func TestTransformQuantityToJindoUnit(t *testing.T) { |
| 90 | testQuantity1 := resource.MustParse("5Gi") |
nothing calls this directly
no test coverage detected