Functional Weave
Code in Python

telecoms.call-rating@1.0.1

vectors.json

31,244 bytes · view raw

[
  {"name": "a UK landline on 60/60: 125 seconds is billed as 3 minutes", "args": ["+441632960001", 125, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "44", "destination": "United Kingdom fixed", "billedSeconds": 180, "usageCharge": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 30, "currency": "GBP"}}},
  {"name": "exactly one minute on 60/60 is one minute", "args": ["441632960001", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "44", "destination": "United Kingdom fixed", "billedSeconds": 60, "usageCharge": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 10, "currency": "GBP"}}},
  {"name": "61 seconds on 60/60 is billed as two minutes", "args": ["441632960001", 61, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "44", "destination": "United Kingdom fixed", "billedSeconds": 120, "usageCharge": {"minor": 20, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 20, "currency": "GBP"}}},
  {"name": "a UK mobile matches 447, the longest prefix, not 44; 125 s on 30/6 is 126 s", "args": ["+447700900123", 125, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "447", "destination": "United Kingdom mobile", "billedSeconds": 126, "usageCharge": {"minor": 53, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "total": {"minor": 58, "currency": "GBP"}}},
  {"name": "the same call rounded down", "args": ["447700900123", 125, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "down"], "expect": {"prefix": "447", "destination": "United Kingdom mobile", "billedSeconds": 126, "usageCharge": {"minor": 52, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "total": {"minor": 57, "currency": "GBP"}}},
  {"name": "a call inside the first increment is billed the whole first increment", "args": ["447700900123", 30, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "447", "destination": "United Kingdom mobile", "billedSeconds": 30, "usageCharge": {"minor": 13, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "total": {"minor": 18, "currency": "GBP"}}},
  {"name": "one second past the first increment adds one 6-second block", "args": ["447700900123", 31, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "447", "destination": "United Kingdom mobile", "billedSeconds": 36, "usageCharge": {"minor": 15, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "total": {"minor": 20, "currency": "GBP"}}},
  {"name": "per-second billing on 1/1", "args": ["12025550123", 61, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "1", "destination": "USA and Canada", "billedSeconds": 61, "usageCharge": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 5, "currency": "GBP"}}},
  {"name": "the same per-second call rounded up", "args": ["12025550123", 61, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "up"], "expect": {"prefix": "1", "destination": "USA and Canada", "billedSeconds": 61, "usageCharge": {"minor": 6, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 6, "currency": "GBP"}}},
  {"name": "a short call to France is raised to the minimum charge", "args": ["33142685300", 10, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "33", "destination": "France fixed", "billedSeconds": 30, "usageCharge": {"minor": 6, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 20, "currency": "GBP"}}},
  {"name": "a French mobile with a connection fee", "args": ["33612345678", 59, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "336", "destination": "France mobile", "billedSeconds": 60, "usageCharge": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "total": {"minor": 40, "currency": "GBP"}}},
  {"name": "an unanswered call costs nothing, minimum charge included", "args": ["33142685300", 0, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expect": {"prefix": "33", "destination": "France fixed", "billedSeconds": 0, "usageCharge": {"minor": 0, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "total": {"minor": 0, "currency": "GBP"}}},
  {"name": "a number no prefix matches is an error", "args": ["81312345678", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "no rate for dialled number 81312345678"},
  {"name": "a number with punctuation is an error", "args": ["44-20-7946-0000", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "dialled number must be international format digits"},
  {"name": "a negative duration is an error", "args": ["441632960001", -1, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "duration must be whole seconds of 0 or more"},
  {"name": "a duplicate prefix in the deck is an error", "args": ["441632960001", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "44", "destination": "UK fixed again", "perMinute": {"minor": 9, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "duplicate prefix 44"},
  {"name": "a zero billing increment is an error", "args": ["441632960001", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 0}], "half-up"], "expectError": "billing increments must be 1 second or more"},
  {"name": "a deck in two currencies is an error", "args": ["441632960001", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "EUR"}, "connectionFee": {"minor": 0, "currency": "EUR"}, "minimumCharge": {"minor": 20, "currency": "EUR"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}], "half-up"], "expectError": "currency mismatch"},
  {"name": "an unknown rounding mode is an error", "args": ["441632960001", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "nearest"], "expectError": "unknown rounding mode"},
  {"name": "a trailing newline is not part of a dialled number", "args": ["442079460000\n", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "dialled number must be international format digits"},
  {"name": "a trailing newline after a leading + is not part of a dialled number", "args": ["+442079460000\n", 60, [{"prefix": "44", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}, {"prefix": "447", "destination": "United Kingdom mobile", "perMinute": {"minor": 25, "currency": "GBP"}, "connectionFee": {"minor": 5, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "1", "destination": "USA and Canada", "perMinute": {"minor": 5, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 1, "nextIncrementSeconds": 1}, {"prefix": "33", "destination": "France fixed", "perMinute": {"minor": 12, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 20, "currency": "GBP"}, "firstIncrementSeconds": 30, "nextIncrementSeconds": 6}, {"prefix": "336", "destination": "France mobile", "perMinute": {"minor": 30, "currency": "GBP"}, "connectionFee": {"minor": 10, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "dialled number must be international format digits"},
  {"name": "a trailing newline is not part of a rate prefix", "args": ["441632960001", 60, [{"prefix": "44\n", "destination": "United Kingdom fixed", "perMinute": {"minor": 10, "currency": "GBP"}, "connectionFee": {"minor": 0, "currency": "GBP"}, "minimumCharge": {"minor": 0, "currency": "GBP"}, "firstIncrementSeconds": 60, "nextIncrementSeconds": 60}], "half-up"], "expectError": "rate prefix must be digits"}
]