// compareIntVals converts the expected and actual values into int values,
// reporting any conversion failure and then checks that they are the same
// reporting any differeinces
compareIntVals converts the expected and actual values into int values,
reporting any conversion failure and then checks that they are the same
reporting any differeinces
// compareIntVals converts the expected and actual values into int values // reporting any conversion failure and then checks that they are the same // reporting any differeinces
func compareIntVals(t *testing.T, id string, expected, actual interface{}) {
	t.Helper()
	expVal, ok := expected.(dataframe.IntVal)
	if !ok {
		t.Fatal(id, ": BAD TEST - expVal should have been of type int")
		return
	}
	actualVal, ok := actual.(dataframe.IntVal)
	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 compareIntVals ( t * testing . T , id string , expected , actual interface { } ) { t . Helper ( ) expVal , ok := expected . ( dataframe . IntVal ) if ! ok { t . Fatal ( id , " " ) return } actualVal , ok := actual . ( dataframe . IntVal ) 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 " ) } }
compareIntVals converts the expected and actual values into int values,
reporting any conversion failure and then checks that they are the same
reporting any differeinces
compareIntVals converts the expected and actual values into int values reporting any conversion failure and then checks that they are the same reporting any differeinces