func TestQuantitySubZeroPreservesSuffix(t *testing.T) {
	testValues := []string{"100m", "1Gi"}
	zero := MustParse("0")
	for _, testValue := range testValues {
		value := MustParse(testValue)
		v1 := value.DeepCopy()
		// ensure non-zero - zero = non-zero (suffix preserved)
		v1.Sub(zero)
		// ensure we preserved the input value
		if v1.String() != testValue {
			t.Errorf("Expected %v, actual %v", testValue, v1.String())
		}

		// ensure zero - non-zero = -non-zero (suffix preserved)
		v2 := zero.DeepCopy()
		v2.Sub(value)
		negVal := value.DeepCopy()
		negVal.Neg()
		if v2.String() != negVal.String() {
			t.Errorf("Expected %v, actual %v", negVal.String(), v2.String())
		}
	}
}
// TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved
// independent of the order of operations when subtracting a zero and non-zero val
TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved
independent of the order of operations when subtracting a zero and non-zero val
// TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved // independent of the order of operations when subtracting a zero and non - zero val
func TestQuantitySubZeroPreservesSuffix(t *testing.T) {
	testValues := []string{"100m", "1Gi"}
	zero := MustParse("0")
	for _, testValue := range testValues {
		value := MustParse(testValue)
		v1 := value.DeepCopy()
		v1.Sub(zero)
		if v1.String() != testValue {
			t.Errorf("Expected %v, actual %v", testValue, v1.String())
		}
		v2 := zero.DeepCopy()
		v2.Sub(value)
		negVal := value.DeepCopy()
		negVal.Neg()
		if v2.String() != negVal.String() {
			t.Errorf("Expected %v, actual %v", negVal.String(), v2.String())
		}
	}
}
func TestQuantitySubZeroPreservesSuffix ( t * testing . T ) { testValues := [ ] string { " " , " " } zero := MustParse ( " " ) for _ , testValue := range testValues { value := MustParse ( testValue ) v1 := value . DeepCopy ( ) v1 . Sub ( zero ) if v1 . String ( ) != testValue { t . Errorf ( " " , testValue , v1 . String ( ) ) } v2 := zero . DeepCopy ( ) v2 . Sub ( value ) negVal := value . DeepCopy ( ) negVal . Neg ( ) if v2 . String ( ) != negVal . String ( ) { t . Errorf ( " " , negVal . String ( ) , v2 . String ( ) ) } } }
TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved
independent of the order of operations when subtracting a zero and non-zero val
TestQuantitySubZeroPreservesSuffix verifies that a suffix is preserved independent of the order of operations when subtracting a zero and non - zero val
// ensure non-zero - zero = non-zero (suffix preserved) // ensure we preserved the input value // ensure zero - non-zero = -non-zero (suffix preserved)