Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
test markup, will be hidden
Test
test("toRange has the proper interface", function() { equals(typeof toRange, "function", "'toRange' should be a function"); });
test("toRange generates proper ranges for single-digit integers", function() { equals(toRange(9), "(?:\\d)", "'toRange' should return '\\d' for value of 9"); });
test("toRange generates proper ranges for double-digit integers", function() { equals(toRange(20), "(?:\\d|1\\d|20)", "'toRange' should return simple regex for 0 - 20"); });
test("More complicated ranges are generated properly", function() { equals(toRange(267, 4301), "(?:26[7-9]|2[7-9]\\d|[3-9]\\d\\d|[1-3]\\d\\d\\d|4[0-2]\\d\\d|430[0-1])", "Complex ranges should work.") });