// TestAlphaToRune checks that an alpha value would be converted to the
// expected rune when executing RGBRuneFromColor.
TestAlphaToRune checks that an alpha value would be converted to the
expected rune when executing RGBRuneFromColor.
// TestAlphaToRune checks that an alpha value would be converted to the // expected rune when executing RGBRuneFromColor .
func TestAlphaToRune(t *testing.T) {
	for i, alpha := range [len(AlphaChars)]uint32{
		(0xFFFF / 5) - 1,
		2*(0xFFFF/5) - 1,
		3*(0xFFFF/5) - 1,
		4*(0xFFFF/5) - 1,
		0xFFFF - 1,
	} {
		expected := AlphaChars[i]
		actual := RGBRuneFromColor(FakeColor(alpha)).Rune
		if actual != expected {
			t.Errorf(`Alpha %v converted to %q, want %q`, alpha, actual, expected)
		}
	}
}
func TestAlphaToRune ( t * testing . T ) { for i , alpha := range [ len ( AlphaChars ) ] uint32 { ( 0xFFFF / 5 ) - 1 , 2 * ( 0xFFFF / 5 ) - 1 , 3 * ( 0xFFFF / 5 ) - 1 , 4 * ( 0xFFFF / 5 ) - 1 , 0xFFFF - 1 , } { expected := AlphaChars [ i ] actual := RGBRuneFromColor ( FakeColor ( alpha ) ) . Rune if actual != expected { t . Errorf ( `Alpha %v converted to %q, want %q` , alpha , actual , expected ) } } }
TestAlphaToRune checks that an alpha value would be converted to the
expected rune when executing RGBRuneFromColor.
TestAlphaToRune checks that an alpha value would be converted to the expected rune when executing RGBRuneFromColor .