packageodd_testimport("testing""github.com/aminnairi/odd")funcTestOnes(t*testing.T){varexpectationuint8=1ones:=[]uint{170,2,7,10}for_,value:=rangeones{result:=odd.AnyOdd(value)ifresult!=expectation{t.Errorf("oddAnyOdd(%d) should be %d, %d received",value,expectation,result)}}}funcTestZeros(t*testing.T){varexpectationuint8=0zeros:=[]uint{5,21,85,341}for_,value:=rangezeros{result:=odd.AnyOdd(value)ifresult!=expectation{t.Errorf("oddAnyOdd(%d) should be %d, %d received",value,expectation,result)}}}
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Go
Tests