Skip to content

Commit 092a195

Browse files
committed
Backup documentation with tests
1 parent f5f0d26 commit 092a195

7 files changed

Lines changed: 316 additions & 0 deletions

File tree

tests/data/areas.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
{
4848
"base" : "BT358GE",
4949
"expected" : "BT"
50+
},
51+
{
52+
"base": "AA9A 9AA",
53+
"expected": "AA"
54+
},
55+
{
56+
"base": "A9A 9AA",
57+
"expected": "A"
58+
},
59+
{
60+
"base": "A9 9AA",
61+
"expected": "A"
62+
},
63+
{
64+
"base": "A99 9AA",
65+
"expected": "A"
66+
},
67+
{
68+
"base": "AA9 9AA",
69+
"expected": "AA"
70+
},
71+
{
72+
"base": "AA99 9AA",
73+
"expected": "AA"
74+
},
75+
{
76+
"base": "AA9A9AA",
77+
"expected": "AA"
78+
},
79+
{
80+
"base": "A9A9AA",
81+
"expected": "A"
82+
},
83+
{
84+
"base": "A99AA",
85+
"expected": "A"
86+
},
87+
{
88+
"base": "A999AA",
89+
"expected": "A"
90+
},
91+
{
92+
"base": "AA99AA",
93+
"expected": "AA"
94+
},
95+
{
96+
"base": "AA999AA",
97+
"expected": "AA"
5098
}
5199
]
52100
}

tests/data/districts.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,58 @@
6363
{
6464
"base" : "N1C 0AB",
6565
"expected" : "N1"
66+
},
67+
{
68+
"base": "AA9A 9AA",
69+
"expected": "AA9"
70+
},
71+
{
72+
"base": "A9A 9AA",
73+
"expected": "A9"
74+
},
75+
{
76+
"base": "A9 9AA",
77+
"expected": "A9"
78+
},
79+
{
80+
"base": "A99 9AA",
81+
"expected": "A99"
82+
},
83+
{
84+
"base": "AA9 9AA",
85+
"expected": "AA9"
86+
},
87+
{
88+
"base": "AA99 9AA",
89+
"expected": "AA99"
90+
},
91+
{
92+
"base" : "N1C 0AB",
93+
"expected" : "N1"
94+
},
95+
{
96+
"base": "AA9A9AA",
97+
"expected": "AA9"
98+
},
99+
{
100+
"base": "A9A9AA",
101+
"expected": "A9"
102+
},
103+
{
104+
"base": "A99AA",
105+
"expected": "A9"
106+
},
107+
{
108+
"base": "A999AA",
109+
"expected": "A99"
110+
},
111+
{
112+
"base": "AA99AA",
113+
"expected": "AA9"
114+
},
115+
{
116+
"base": "AA999AA",
117+
"expected": "AA99"
66118
}
67119
]
68120
}

tests/data/incodes.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
{
4848
"base" : "BT358GE",
4949
"expected" : "8GE"
50+
},
51+
{
52+
"base": "AA9A 9AA",
53+
"expected": "9AA"
54+
},
55+
{
56+
"base": "A9A 9AA",
57+
"expected": "9AA"
58+
},
59+
{
60+
"base": "A9 9AA",
61+
"expected": "9AA"
62+
},
63+
{
64+
"base": "A99 9AA",
65+
"expected": "9AA"
66+
},
67+
{
68+
"base": "AA9 9AA",
69+
"expected": "9AA"
70+
},
71+
{
72+
"base": "AA99 9AA",
73+
"expected": "9AA"
74+
},
75+
{
76+
"base": "AA9A9AA",
77+
"expected": "9AA"
78+
},
79+
{
80+
"base": "A9A9AA",
81+
"expected": "9AA"
82+
},
83+
{
84+
"base": "A99AA",
85+
"expected": "9AA"
86+
},
87+
{
88+
"base": "A999AA",
89+
"expected": "9AA"
90+
},
91+
{
92+
"base": "AA99AA",
93+
"expected": "9AA"
94+
},
95+
{
96+
"base": "AA999AA",
97+
"expected": "9AA"
5098
}
5199
]
52100
}

tests/data/outcodes.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
{
4848
"base" : "BT358GE",
4949
"expected" : "BT35"
50+
},
51+
{
52+
"base": "AA9A 9AA",
53+
"expected": "AA9A"
54+
},
55+
{
56+
"base": "A9A 9AA",
57+
"expected": "A9A"
58+
},
59+
{
60+
"base": "A9 9AA",
61+
"expected": "A9"
62+
},
63+
{
64+
"base": "A99 9AA",
65+
"expected": "A99"
66+
},
67+
{
68+
"base": "AA9 9AA",
69+
"expected": "AA9"
70+
},
71+
{
72+
"base": "AA99 9AA",
73+
"expected": "AA99"
74+
},
75+
{
76+
"base": "AA9A9AA",
77+
"expected": "AA9A"
78+
},
79+
{
80+
"base": "A9A9AA",
81+
"expected": "A9A"
82+
},
83+
{
84+
"base": "A99AA",
85+
"expected": "A9"
86+
},
87+
{
88+
"base": "A999AA",
89+
"expected": "A99"
90+
},
91+
{
92+
"base": "AA99AA",
93+
"expected": "AA9"
94+
},
95+
{
96+
"base": "AA999AA",
97+
"expected": "AA99"
5098
}
5199
]
52100
}

tests/data/sectors.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
{
4848
"base" : "BT358GE",
4949
"expected" : "BT35 8"
50+
},
51+
{
52+
"base": "AA9A 9AA",
53+
"expected": "AA9A 9"
54+
},
55+
{
56+
"base": "A9A 9AA",
57+
"expected": "A9A 9"
58+
},
59+
{
60+
"base": "A9 9AA",
61+
"expected": "A9 9"
62+
},
63+
{
64+
"base": "A99 9AA",
65+
"expected": "A99 9"
66+
},
67+
{
68+
"base": "AA9 9AA",
69+
"expected": "AA9 9"
70+
},
71+
{
72+
"base": "AA99 9AA",
73+
"expected": "AA99 9"
74+
},
75+
{
76+
"base": "AA9A9AA",
77+
"expected": "AA9A 9"
78+
},
79+
{
80+
"base": "A9A9AA",
81+
"expected": "A9A 9"
82+
},
83+
{
84+
"base": "A99AA",
85+
"expected": "A9 9"
86+
},
87+
{
88+
"base": "A999AA",
89+
"expected": "A99 9"
90+
},
91+
{
92+
"base": "AA99AA",
93+
"expected": "AA9 9"
94+
},
95+
{
96+
"base": "AA999AA",
97+
"expected": "AA99 9"
5098
}
5199
]
52100
}

tests/data/sub-districts.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,30 @@
6363
{
6464
"base" : "N1C 0AB",
6565
"expected" : "N1C"
66+
},
67+
{
68+
"base": "AA9A 9AA",
69+
"expected": "AA9A"
70+
},
71+
{
72+
"base": "A9A 9AA",
73+
"expected": "A9A"
74+
},
75+
{
76+
"base": "A9 9AA",
77+
"expected": null
78+
},
79+
{
80+
"base": "A99 9AA",
81+
"expected": null
82+
},
83+
{
84+
"base": "AA9 9AA",
85+
"expected": null
86+
},
87+
{
88+
"base": "AA99 9AA",
89+
"expected": null
6690
}
6791
]
6892
}

tests/data/units.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,54 @@
4747
{
4848
"base" : "BT358GE",
4949
"expected" : "GE"
50+
},
51+
{
52+
"base": "AA9A 9AA",
53+
"expected": "AA"
54+
},
55+
{
56+
"base": "A9A 9AA",
57+
"expected": "AA"
58+
},
59+
{
60+
"base": "A9 9AA",
61+
"expected": "AA"
62+
},
63+
{
64+
"base": "A99 9AA",
65+
"expected": "AA"
66+
},
67+
{
68+
"base": "AA9 9AA",
69+
"expected": "AA"
70+
},
71+
{
72+
"base": "AA99 9AA",
73+
"expected": "AA"
74+
},
75+
{
76+
"base": "AA9A9AA",
77+
"expected": "AA"
78+
},
79+
{
80+
"base": "A9A9AA",
81+
"expected": "AA"
82+
},
83+
{
84+
"base": "A99AA",
85+
"expected": "AA"
86+
},
87+
{
88+
"base": "A999AA",
89+
"expected": "AA"
90+
},
91+
{
92+
"base": "AA99AA",
93+
"expected": "AA"
94+
},
95+
{
96+
"base": "AA999AA",
97+
"expected": "AA"
5098
}
5199
]
52100
}

0 commit comments

Comments
 (0)