### ----------------------------------------------------
### -- Number::More
### -- Licenses: Artistic-2.0
### -- Authors: Tom Browder <tbrowder@acm.org>
### -- File: t/6-auto-transform-checks.t
### ----------------------------------------------------
### -- Chunk 1 of 3
use Test;

use Number::More :ALL;

#plan 456;
plan 92;

my $suffix = True;

is rebase(642, 10, 3), "212210", "base 3; test 1";
is rebase("1010000010", 2, 3), "212210", "base 3; test 2";
is rebase("1202", 8, 3), "212210", "base 3; test 3";
is rebase("282", 16, 3), "212210", "base 3; test 4";

# add the suffix
is rebase(642, 10, 3, :$suffix), "212210\x2083", "base 3; test 5";
is rebase("1010000010", 2, 3, :$suffix), "212210\x2083", "base 3; test 6";
is rebase("1202", 8, 3, :$suffix), "212210\x2083", "base 3; test 7";
is rebase("282", 16, 3, :$suffix), "212210\x2083", "base 3; test 8";

is rebase(3612, 10, 4), "320130", "base 4; test 9";
is rebase("111000011100", 2, 4), "320130", "base 4; test 10";
is rebase("7034", 8, 4), "320130", "base 4; test 11";
is rebase("E1C", 16, 4), "320130", "base 4; test 12";

# add the suffix
is rebase(3612, 10, 4, :$suffix), "320130\x2084", "base 4; test 13";
is rebase("111000011100", 2, 4, :$suffix), "320130\x2084", "base 4; test 14";
is rebase("7034", 8, 4, :$suffix), "320130\x2084", "base 4; test 15";
is rebase("E1C", 16, 4, :$suffix), "320130\x2084", "base 4; test 16";

is rebase(2832, 10, 5), "42312", "base 5; test 17";
is rebase("101100010000", 2, 5), "42312", "base 5; test 18";
is rebase("5420", 8, 5), "42312", "base 5; test 19";
is rebase("B10", 16, 5), "42312", "base 5; test 20";

# add the suffix
is rebase(2832, 10, 5, :$suffix), "42312\x2085", "base 5; test 21";
is rebase("101100010000", 2, 5, :$suffix), "42312\x2085", "base 5; test 22";
is rebase("5420", 8, 5, :$suffix), "42312\x2085", "base 5; test 23";
is rebase("B10", 16, 5, :$suffix), "42312\x2085", "base 5; test 24";

is rebase(5735, 10, 6), "42315", "base 6; test 25";
is rebase("1011001100111", 2, 6), "42315", "base 6; test 26";
is rebase("13147", 8, 6), "42315", "base 6; test 27";
is rebase("1667", 16, 6), "42315", "base 6; test 28";

# add the suffix
is rebase(5735, 10, 6, :$suffix), "42315\x2086", "base 6; test 29";
is rebase("1011001100111", 2, 6, :$suffix), "42315\x2086", "base 6; test 30";
is rebase("13147", 8, 6, :$suffix), "42315\x2086", "base 6; test 31";
is rebase("1667", 16, 6, :$suffix), "42315\x2086", "base 6; test 32";

is rebase(15251, 10, 7), "62315", "base 7; test 33";
is rebase("11101110010011", 2, 7), "62315", "base 7; test 34";
is rebase("35623", 8, 7), "62315", "base 7; test 35";
is rebase("3B93", 16, 7), "62315", "base 7; test 36";

# add the suffix
is rebase(15251, 10, 7, :$suffix), "62315\x2087", "base 7; test 37";
is rebase("11101110010011", 2, 7, :$suffix), "62315\x2087", "base 7; test 38";
is rebase("35623", 8, 7, :$suffix), "62315\x2087", "base 7; test 39";
is rebase("3B93", 16, 7, :$suffix), "62315\x2087", "base 7; test 40";

is rebase(4615, 10, 9), "6287", "base 9; test 41";
is rebase("1001000000111", 2, 9), "6287", "base 9; test 42";
is rebase("11007", 8, 9), "6287", "base 9; test 43";
is rebase("1207", 16, 9), "6287", "base 9; test 44";

# add the suffix
is rebase(4615, 10, 9, :$suffix), "6287\x2089", "base 9; test 45";
is rebase("1001000000111", 2, 9, :$suffix), "6287\x2089", "base 9; test 46";
is rebase("11007", 8, 9, :$suffix), "6287\x2089", "base 9; test 47";
is rebase("1207", 16, 9, :$suffix), "6287\x2089", "base 9; test 48";

is rebase(13396, 10, 11), "A079", "base 11; test 49";
is rebase("11010001010100", 2, 11), "A079", "base 11; test 50";
is rebase("32124", 8, 11), "A079", "base 11; test 51";
is rebase("3454", 16, 11), "A079", "base 11; test 52";

# add the suffix
is rebase(13396, 10, 11, :$suffix), "A079\x2081\x2081", "base 11; test 53";
is rebase("11010001010100", 2, 11, :$suffix), "A079\x2081\x2081", "base 11; test 54";
is rebase("32124", 8, 11, :$suffix), "A079\x2081\x2081", "base 11; test 55";
is rebase("3454", 16, 11, :$suffix), "A079\x2081\x2081", "base 11; test 56";

is rebase(17375, 10, 12), "A07B", "base 12; test 57";
is rebase("100001111011111", 2, 12), "A07B", "base 12; test 58";
is rebase("41737", 8, 12), "A07B", "base 12; test 59";
is rebase("43DF", 16, 12), "A07B", "base 12; test 60";

# add the suffix
is rebase(17375, 10, 12, :$suffix), "A07B\x2081\x2082", "base 12; test 61";
is rebase("100001111011111", 2, 12, :$suffix), "A07B\x2081\x2082", "base 12; test 62";
is rebase("41737", 8, 12, :$suffix), "A07B\x2081\x2082", "base 12; test 63";
is rebase("43DF", 16, 12, :$suffix), "A07B\x2081\x2082", "base 12; test 64";

is rebase(1975, 10, 13), "B8C", "base 13; test 65";
is rebase("11110110111", 2, 13), "B8C", "base 13; test 66";
is rebase("3667", 8, 13), "B8C", "base 13; test 67";
is rebase("7B7", 16, 13), "B8C", "base 13; test 68";

# add the suffix
is rebase(1975, 10, 13, :$suffix), "B8C\x2081\x2083", "base 13; test 69";
is rebase("11110110111", 2, 13, :$suffix), "B8C\x2081\x2083", "base 13; test 70";
is rebase("3667", 8, 13, :$suffix), "B8C\x2081\x2083", "base 13; test 71";
is rebase("7B7", 16, 13, :$suffix), "B8C\x2081\x2083", "base 13; test 72";

is rebase(34290, 10, 14), "C6D4", "base 14; test 73";
is rebase("1000010111110010", 2, 14), "C6D4", "base 14; test 74";
is rebase("102762", 8, 14), "C6D4", "base 14; test 75";
is rebase("85F2", 16, 14), "C6D4", "base 14; test 76";

# add the suffix
is rebase(34290, 10, 14, :$suffix), "C6D4\x2081\x2084", "base 14; test 77";
is rebase("1000010111110010", 2, 14, :$suffix), "C6D4\x2081\x2084", "base 14; test 78";
is rebase("102762", 8, 14, :$suffix), "C6D4\x2081\x2084", "base 14; test 79";
is rebase("85F2", 16, 14, :$suffix), "C6D4\x2081\x2084", "base 14; test 80";

is rebase(49562, 10, 15), "EA42", "base 15; test 81";
is rebase("1100000110011010", 2, 15), "EA42", "base 15; test 82";
is rebase("140632", 8, 15), "EA42", "base 15; test 83";
is rebase("C19A", 16, 15), "EA42", "base 15; test 84";

# add the suffix
is rebase(49562, 10, 15, :$suffix), "EA42\x2081\x2085", "base 15; test 85";
is rebase("1100000110011010", 2, 15, :$suffix), "EA42\x2081\x2085", "base 15; test 86";
is rebase("140632", 8, 15, :$suffix), "EA42\x2081\x2085", "base 15; test 87";
is rebase("C19A", 16, 15, :$suffix), "EA42\x2081\x2085", "base 15; test 88";

is rebase(71464, 10, 17), "E94D", "base 17; test 89";
is rebase("10001011100101000", 2, 17), "E94D", "base 17; test 90";
is rebase("213450", 8, 17), "E94D", "base 17; test 91";
is rebase("11728", 16, 17), "E94D", "base 17; test 92";

=finish

# add the suffix
is rebase(71464, 10, 17, :$suffix), "E94D_base-17", "base 17; test 93";
is rebase("10001011100101000", 2, 17, :$suffix), "E94D_base-17", "base 17; test 94";
is rebase("213450", 8, 17, :$suffix), "E94D_base-17", "base 17; test 95";
is rebase("11728", 16, 17, :$suffix), "E94D_base-17", "base 17; test 96";

is rebase(96573, 10, 18), "GA13", "base 18; test 97";
is rebase("10111100100111101", 2, 18), "GA13", "base 18; test 98";
is rebase("274475", 8, 18), "GA13", "base 18; test 99";
is rebase("1793D", 16, 18), "GA13", "base 18; test 100";

# add the suffix
is rebase(96573, 10, 18, :$suffix), "GA13_base-18", "base 18; test 101";
is rebase("10111100100111101", 2, 18, :$suffix), "GA13_base-18", "base 18; test 102";
is rebase("274475", 8, 18, :$suffix), "GA13_base-18", "base 18; test 103";
is rebase("1793D", 16, 18, :$suffix), "GA13_base-18", "base 18; test 104";

is rebase(6355, 10, 19), "HB9", "base 19; test 105";
is rebase("1100011010011", 2, 19), "HB9", "base 19; test 106";
is rebase("14323", 8, 19), "HB9", "base 19; test 107";
is rebase("18D3", 16, 19), "HB9", "base 19; test 108";

# add the suffix
is rebase(6355, 10, 19, :$suffix), "HB9_base-19", "base 19; test 109";
is rebase("1100011010011", 2, 19, :$suffix), "HB9_base-19", "base 19; test 110";
is rebase("14323", 8, 19, :$suffix), "HB9_base-19", "base 19; test 111";
is rebase("18D3", 16, 19, :$suffix), "HB9_base-19", "base 19; test 112";

is rebase(148847, 10, 20), "IC27", "base 20; test 113";
is rebase("100100010101101111", 2, 20), "IC27", "base 20; test 114";
is rebase("442557", 8, 20), "IC27", "base 20; test 115";
is rebase("2456F", 16, 20), "IC27", "base 20; test 116";

# add the suffix
is rebase(148847, 10, 20, :$suffix), "IC27_base-20", "base 20; test 117";
is rebase("100100010101101111", 2, 20, :$suffix), "IC27_base-20", "base 20; test 118";
is rebase("442557", 8, 20, :$suffix), "IC27_base-20", "base 20; test 119";
is rebase("2456F", 16, 20, :$suffix), "IC27_base-20", "base 20; test 120";

is rebase(7878, 10, 21), "HI3", "base 21; test 121";
is rebase("1111011000110", 2, 21), "HI3", "base 21; test 122";
is rebase("17306", 8, 21), "HI3", "base 21; test 123";
is rebase("1EC6", 16, 21), "HI3", "base 21; test 124";

# add the suffix
is rebase(7878, 10, 21, :$suffix), "HI3_base-21", "base 21; test 125";
is rebase("1111011000110", 2, 21, :$suffix), "HI3_base-21", "base 21; test 126";
is rebase("17306", 8, 21, :$suffix), "HI3_base-21", "base 21; test 127";
is rebase("1EC6", 16, 21, :$suffix), "HI3_base-21", "base 21; test 128";

is rebase(9531, 10, 22), "JF5", "base 22; test 129";
is rebase("10010100111011", 2, 22), "JF5", "base 22; test 130";
is rebase("22473", 8, 22), "JF5", "base 22; test 131";
is rebase("253B", 16, 22), "JF5", "base 22; test 132";

# add the suffix
is rebase(9531, 10, 22, :$suffix), "JF5_base-22", "base 22; test 133";
is rebase("10010100111011", 2, 22, :$suffix), "JF5_base-22", "base 22; test 134";
is rebase("22473", 8, 22, :$suffix), "JF5_base-22", "base 22; test 135";
is rebase("253B", 16, 22, :$suffix), "JF5_base-22", "base 22; test 136";

is rebase(11004, 10, 23), "KIA", "base 23; test 137";
is rebase("10101011111100", 2, 23), "KIA", "base 23; test 138";
is rebase("25374", 8, 23), "KIA", "base 23; test 139";
is rebase("2AFC", 16, 23), "KIA", "base 23; test 140";

# add the suffix
is rebase(11004, 10, 23, :$suffix), "KIA_base-23", "base 23; test 141";
is rebase("10101011111100", 2, 23, :$suffix), "KIA_base-23", "base 23; test 142";
is rebase("25374", 8, 23, :$suffix), "KIA_base-23", "base 23; test 143";
is rebase("2AFC", 16, 23, :$suffix), "KIA_base-23", "base 23; test 144";

is rebase(150633, 10, 24), "ALC9", "base 24; test 145";
is rebase("100100110001101001", 2, 24), "ALC9", "base 24; test 146";
is rebase("446151", 8, 24), "ALC9", "base 24; test 147";
is rebase("24C69", 16, 24), "ALC9", "base 24; test 148";

# add the suffix
is rebase(150633, 10, 24, :$suffix), "ALC9_base-24", "base 24; test 149";
is rebase("100100110001101001", 2, 24, :$suffix), "ALC9_base-24", "base 24; test 150";
is rebase("446151", 8, 24, :$suffix), "ALC9_base-24", "base 24; test 151";
is rebase("24C69", 16, 24, :$suffix), "ALC9_base-24", "base 24; test 152";

is rebase(355546, 10, 25), "MILL", "base 25; test 153";
is rebase("1010110110011011010", 2, 25), "MILL", "base 25; test 154";
is rebase("1266332", 8, 25), "MILL", "base 25; test 155";
is rebase("56CDA", 16, 25), "MILL", "base 25; test 156";

# add the suffix
is rebase(355546, 10, 25, :$suffix), "MILL_base-25", "base 25; test 157";
is rebase("1010110110011011010", 2, 25, :$suffix), "MILL_base-25", "base 25; test 158";
is rebase("1266332", 8, 25, :$suffix), "MILL_base-25", "base 25; test 159";
is rebase("56CDA", 16, 25, :$suffix), "MILL_base-25", "base 25; test 160";

is rebase(15259, 10, 26), "MEN", "base 26; test 161";
is rebase("11101110011011", 2, 26), "MEN", "base 26; test 162";
is rebase("35633", 8, 26), "MEN", "base 26; test 163";
is rebase("3B9B", 16, 26), "MEN", "base 26; test 164";

# add the suffix
is rebase(15259, 10, 26, :$suffix), "MEN_base-26", "base 26; test 165";
is rebase("11101110011011", 2, 26, :$suffix), "MEN_base-26", "base 26; test 166";
is rebase("35633", 8, 26, :$suffix), "MEN_base-26", "base 26; test 167";
is rebase("3B9B", 16, 26, :$suffix), "MEN_base-26", "base 26; test 168";

is rebase(16332, 10, 27), "MAO", "base 27; test 169";
is rebase("11111111001100", 2, 27), "MAO", "base 27; test 170";
is rebase("37714", 8, 27), "MAO", "base 27; test 171";
is rebase("3FCC", 16, 27), "MAO", "base 27; test 172";

# add the suffix
is rebase(16332, 10, 27, :$suffix), "MAO_base-27", "base 27; test 173";
is rebase("11111111001100", 2, 27, :$suffix), "MAO_base-27", "base 27; test 174";
is rebase("37714", 8, 27, :$suffix), "MAO_base-27", "base 27; test 175";
is rebase("3FCC", 16, 27, :$suffix), "MAO_base-27", "base 27; test 176";

is rebase(19901, 10, 28), "PAL", "base 28; test 177";
is rebase("100110110111101", 2, 28), "PAL", "base 28; test 178";
is rebase("46675", 8, 28), "PAL", "base 28; test 179";
is rebase("4DBD", 16, 28), "PAL", "base 28; test 180";

# add the suffix
is rebase(19901, 10, 28, :$suffix), "PAL_base-28", "base 28; test 181";
is rebase("100110110111101", 2, 28, :$suffix), "PAL_base-28", "base 28; test 182";
is rebase("46675", 8, 28, :$suffix), "PAL_base-28", "base 28; test 183";
is rebase("4DBD", 16, 28, :$suffix), "PAL_base-28", "base 28; test 184";

is rebase(21997, 10, 29), "Q4F", "base 29; test 185";
is rebase("101010111101101", 2, 29), "Q4F", "base 29; test 186";
is rebase("52755", 8, 29), "Q4F", "base 29; test 187";
is rebase("55ED", 16, 29), "Q4F", "base 29; test 188";

# add the suffix
is rebase(21997, 10, 29, :$suffix), "Q4F_base-29", "base 29; test 189";
is rebase("101010111101101", 2, 29, :$suffix), "Q4F_base-29", "base 29; test 190";
is rebase("52755", 8, 29, :$suffix), "Q4F_base-29", "base 29; test 191";
is rebase("55ED", 16, 29, :$suffix), "Q4F_base-29", "base 29; test 192";

is rebase(24613, 10, 30), "RAD", "base 30; test 193";
is rebase("110000000100101", 2, 30), "RAD", "base 30; test 194";
is rebase("60045", 8, 30), "RAD", "base 30; test 195";
is rebase("6025", 16, 30), "RAD", "base 30; test 196";

# add the suffix
is rebase(24613, 10, 30, :$suffix), "RAD_base-30", "base 30; test 197";
is re