// compareFloatVals converts the expected and actual values into float values,
// reporting any conversion failure and then checks that they are the same
// reporting any differeinces
compareFloatVals converts the expected and actual values into float values,
reporting any conversion failure and then checks that they are the same
reporting any differeinces
// compareFloatVals converts the expected and actual values into float values // reporting any conversion failure and then checks that they are the same // reporting any differeinces
func compareFloatVals(t *testing.T, id string, expected, actual interface{}) {
	t.Helper()
	expVal, ok := expected.(dataframe.FloatVal)
	if !ok {
		t.Fatal(id, ": BAD TEST - expVal should have been of type float")
		return
	}
	actualVal, ok := actual.(dataframe.FloatVal)
	if !ok {
		t.Log(id)
		t.Logf("\t: expected type: %T", expVal)
		t.Logf("\t:   actual type: %T", actual)
		t.Errorf("\t: value type doesn't match the returned type")
	} else if actualVal.IsNA != expVal.IsNA {
		t.Log(id)
		t.Logf("\t: expected IsNA: %v", expVal.IsNA)
		t.Logf("\t:   actual IsNA: %v", actualVal.IsNA)
		t.Errorf("\t: the IsNA flags don't match")
	} else if !actualVal.IsNA && expVal.Val != actualVal.Val {
		t.Log(id)
		t.Logf("\t: expected val: %v", expVal.Val)
		t.Logf("\t:   actual val: %v", actualVal.Val)
		t.Errorf("\t: the values don't match")
	}
}
func compareFloatVals ( t * testing . T , id string , expected , actual interface { } ) { t . Helper ( ) expVal , ok := expected . ( dataframe . FloatVal ) if ! ok { t . Fatal ( id , " " ) return } actualVal , ok := actual . ( dataframe . FloatVal ) if ! ok { t . Log ( id ) t . Logf ( " \t " , expVal ) t . Logf ( " \t " , actual ) t . Errorf ( " \t " ) } else if actualVal . IsNA != expVal . IsNA { t . Log ( id ) t . Logf ( " \t " , expVal . IsNA ) t . Logf ( " \t " , actualVal . IsNA ) t . Errorf ( " \t " ) } else if ! actualVal . IsNA && expVal . Val != actualVal . Val { t . Log ( id ) t . Logf ( " \t " , expVal . Val ) t . Logf ( " \t " , actualVal . Val ) t . Errorf ( " \t " ) } }
compareFloatVals converts the expected and actual values into float values,
reporting any conversion failure and then checks that they are the same
reporting any differeinces
compareFloatVals converts the expected and actual values into float values reporting any conversion failure and then checks that they are the same reporting any differeinces