2021-05-11 20:21:06 +00:00
|
|
|
package abcex
|
|
|
|
|
2024-08-08 11:53:11 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"testing"
|
|
|
|
)
|
2021-05-11 20:21:06 +00:00
|
|
|
|
|
|
|
func TestEncode(t *testing.T) {
|
2024-08-08 11:53:11 +00:00
|
|
|
fmt.Println(Encode(12345))
|
|
|
|
// Output: 9ix
|
2021-05-11 20:21:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func TestDecode(t *testing.T) {
|
2024-08-08 11:53:11 +00:00
|
|
|
fmt.Println(Decode("9ix"))
|
|
|
|
// Output: 12345
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestZero(t *testing.T) {
|
|
|
|
fmt.Println(Encode(0))
|
|
|
|
// Output: 0
|
|
|
|
|
|
|
|
fmt.Println(Decode("0"))
|
|
|
|
// Output: 0
|
2021-05-11 20:21:06 +00:00
|
|
|
}
|