3 -- Turn off echo and keep things quiet.
5 -- Format the output for nice TAP.
10 -- Revert all changes on failure.
11 \set ON_ERROR_ROLLBACK 1
12 \set ON_ERROR_STOP true
15 -- Load the TAP functions.
21 -- Run the tests. Converted from Koha's ClassSortRoutine_Dewey.t
24 asset.label_normalizer_dewey(NULL),
30 asset.label_normalizer_dewey('.... .....'),
35 -- I think these tests below may be looking too deeply into the implementation,
36 -- but including them for now
39 asset.label_normalizer_dewey('123 456'),
40 '123_456000000000000',
45 asset.label_normalizer_dewey('abc123 456'),
46 'ABC_123_456000000000000',
47 'testing alphanumeric'
51 asset.label_normalizer_dewey('ab c123 45 6'),
52 'AB_C123_45_600000000000000',
53 'testing middle whitespace'
56 SELECT todo('Desired behavior in contention. See https://bugs.launchpad.net/evergreen/+bug/1150939', 1);
59 asset.label_normalizer_dewey('YR DVD 800.1'),
61 asset.label_normalizer_dewey('YR DVD 900'),
62 'testing prefix plus decimal'
65 -- Finish the tests and clean up.
66 SELECT * FROM finish();