Fixed various errors

This commit is contained in:
Benjamin L. Merritt 2015-11-19 15:47:25 -08:00
parent 4d8069bc65
commit 949cf69c7a
3 changed files with 20 additions and 1 deletions

View File

@ -1,5 +1,6 @@
#include "error_handling.h"
#include <typeinfo>
#include <string>
#include "phonenumbers/phonenumberutil.h"
@ -89,4 +90,3 @@ void logInfo(const char* msg) {
(errcode(ERRCODE_SUCCESSFUL_COMPLETION),
errmsg("%s", msg)));
}

17
expected/regression.out Normal file
View File

@ -0,0 +1,17 @@
CREATE EXTENSION IF NOT EXISTS pg_libphonenumber;
--Test phone number parsing
select parse_phone_number('555-555-5555', 'US');
parse_phone_number
--------------------
+1 555-555-5555
(1 row)
--These two should produce errors because the number is too long.
--Produces an error in pg-libphonenumber's code
select parse_phone_number('555-555-5555555555', 'US');
ERROR: phone number '+1 5555555555555555' is too long
DETAIL: National number is too long
--Produces an error from libphonenumber
select parse_phone_number('555-555-55555555555', 'US');
ERROR: unable to parse '555-555-55555555555' as a phone number
DETAIL: National number is too long

View File

@ -3,6 +3,8 @@ CREATE EXTENSION IF NOT EXISTS pg_libphonenumber;
--Test phone number parsing
select parse_phone_number('555-555-5555', 'US');
--These two should produce errors because the number is too long.
--Produces an error in pg-libphonenumber's code
select parse_phone_number('555-555-5555555555', 'US');
--Produces an error from libphonenumber
select parse_phone_number('555-555-55555555555', 'US');