Compare commits

..

No commits in common. "8249cd3bdffd620537e6dc87e93fee6f38087d93" and "742fd5732640e7fa9c760b0e0fb229affff2b724" have entirely different histories.

3 changed files with 176 additions and 190 deletions

View File

@ -1,95 +0,0 @@
package runesymbols_test
import (
"testing"
"sourcecode.social/reiver/go-hexadeca/symbols/rune"
)
func TestLowerCase(t *testing.T) {
tests := []struct{
Value byte
Expected rune
}{
{
Value: 0,
Expected: '0',
},
{
Value: 1,
Expected: '1',
},
{
Value: 2,
Expected: '2',
},
{
Value: 3,
Expected: '3',
},
{
Value: 4,
Expected: '4',
},
{
Value: 5,
Expected: '5',
},
{
Value: 6,
Expected: '6',
},
{
Value: 7,
Expected: '7',
},
{
Value: 8,
Expected: '8',
},
{
Value: 9,
Expected: '9',
},
{
Value: 10,
Expected: 'a',
},
{
Value: 11,
Expected: 'b',
},
{
Value: 12,
Expected: 'c',
},
{
Value: 13,
Expected: 'd',
},
{
Value: 14,
Expected: 'e',
},
{
Value: 15,
Expected: 'f',
},
}
for testNumber, test := range tests {
actual := runesymbols.LowerCase(test.Value)
expected := test.Expected
if expected != actual {
t.Errorf("For test #%d, the actual value is not what was expected.", testNumber)
t.Logf("EXPECTED: %q (%d)", expected, expected)
t.Logf("ACTUAL: %q (%d)", actual, actual)
t.Logf("VALUE: %x (%d)", test.Value, test.Value)
continue
}
}
}

View File

@ -6,6 +6,94 @@ import (
"sourcecode.social/reiver/go-hexadeca/symbols/rune"
)
func TestLowerCase(t *testing.T) {
tests := []struct{
Value byte
Expected rune
}{
{
Value: 0,
Expected: '0',
},
{
Value: 1,
Expected: '1',
},
{
Value: 2,
Expected: '2',
},
{
Value: 3,
Expected: '3',
},
{
Value: 4,
Expected: '4',
},
{
Value: 5,
Expected: '5',
},
{
Value: 6,
Expected: '6',
},
{
Value: 7,
Expected: '7',
},
{
Value: 8,
Expected: '8',
},
{
Value: 9,
Expected: '9',
},
{
Value: 10,
Expected: 'a',
},
{
Value: 11,
Expected: 'b',
},
{
Value: 12,
Expected: 'c',
},
{
Value: 13,
Expected: 'd',
},
{
Value: 14,
Expected: 'e',
},
{
Value: 15,
Expected: 'f',
},
}
for testNumber, test := range tests {
actual := runesymbols.LowerCase(test.Value)
expected := test.Expected
if expected != actual {
t.Errorf("For test #%d, the actual value is not what was expected.", testNumber)
t.Logf("EXPECTED: %q (%d)", expected, expected)
t.Logf("ACTUAL: %q (%d)", actual, actual)
t.Logf("VALUE: %x (%d)", test.Value, test.Value)
continue
}
}
}
func TestPersian(t *testing.T) {
tests := []struct{
@ -93,3 +181,91 @@ func TestPersian(t *testing.T) {
}
}
func TestUpperCase(t *testing.T) {
tests := []struct{
Value byte
Expected rune
}{
{
Value: 0,
Expected: '0',
},
{
Value: 1,
Expected: '1',
},
{
Value: 2,
Expected: '2',
},
{
Value: 3,
Expected: '3',
},
{
Value: 4,
Expected: '4',
},
{
Value: 5,
Expected: '5',
},
{
Value: 6,
Expected: '6',
},
{
Value: 7,
Expected: '7',
},
{
Value: 8,
Expected: '8',
},
{
Value: 9,
Expected: '9',
},
{
Value: 10,
Expected: 'A',
},
{
Value: 11,
Expected: 'B',
},
{
Value: 12,
Expected: 'C',
},
{
Value: 13,
Expected: 'D',
},
{
Value: 14,
Expected: 'E',
},
{
Value: 15,
Expected: 'F',
},
}
for testNumber, test := range tests {
actual := runesymbols.UpperCase(test.Value)
expected := test.Expected
if expected != actual {
t.Errorf("For test #%d, the actual value is not what was expected.", testNumber)
t.Logf("EXPECTED: %q (%d)", expected, expected)
t.Logf("ACTUAL: %q (%d)", actual, actual)
t.Logf("VALUE: %x (%d)", test.Value, test.Value)
continue
}
}
}

View File

@ -1,95 +0,0 @@
package runesymbols_test
import (
"testing"
"sourcecode.social/reiver/go-hexadeca/symbols/rune"
)
func TestUpperCase(t *testing.T) {
tests := []struct{
Value byte
Expected rune
}{
{
Value: 0,
Expected: '0',
},
{
Value: 1,
Expected: '1',
},
{
Value: 2,
Expected: '2',
},
{
Value: 3,
Expected: '3',
},
{
Value: 4,
Expected: '4',
},
{
Value: 5,
Expected: '5',
},
{
Value: 6,
Expected: '6',
},
{
Value: 7,
Expected: '7',
},
{
Value: 8,
Expected: '8',
},
{
Value: 9,
Expected: '9',
},
{
Value: 10,
Expected: 'A',
},
{
Value: 11,
Expected: 'B',
},
{
Value: 12,
Expected: 'C',
},
{
Value: 13,
Expected: 'D',
},
{
Value: 14,
Expected: 'E',
},
{
Value: 15,
Expected: 'F',
},
}
for testNumber, test := range tests {
actual := runesymbols.UpperCase(test.Value)
expected := test.Expected
if expected != actual {
t.Errorf("For test #%d, the actual value is not what was expected.", testNumber)
t.Logf("EXPECTED: %q (%d)", expected, expected)
t.Logf("ACTUAL: %q (%d)", actual, actual)
t.Logf("VALUE: %x (%d)", test.Value, test.Value)
continue
}
}
}