Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wkt enforce whitespace #277

Closed
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+221 −179
Diff settings

Always

Just for now

WKT: Enforce whitespace between doubles in ptarrays

  • Loading branch information...
Algunenano committed Jul 23, 2018
commit ffbeb8e0ef9f1757b854f3d3296734f72bb0595a
Copy path View file
@@ -346,6 +346,40 @@ static void test_wkt_in_errlocation(void)

}

static void test_wkt_double(void)
{
LWGEOM_PARSER_RESULT p;
int rv = 0;
char *wkt = 0;

wkt = "LINESTRING(1.1.1, 2.2.2)";
lwgeom_parser_result_init(&p);
rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
CU_ASSERT_EQUAL( rv, LW_FAILURE );

wkt = "LINESTRING(1.1 .1, 2.2 .2)";
lwgeom_parser_result_init(&p);
rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
CU_ASSERT_EQUAL( rv, LW_SUCCESS );

wkt = "LINESTRING( 1.1 .1 , 2.2 .2 )";
lwgeom_parser_result_init(&p);
rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
CU_ASSERT_EQUAL( rv, LW_SUCCESS );

wkt = "LINESTRING(\n1.1\n.1,\n2.2\n.2\n)";
lwgeom_parser_result_init(&p);
rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
CU_ASSERT_EQUAL( rv, LW_SUCCESS );

wkt = "LINESTRING(1.1\t.1\t,\t2.2\t.2\t)";
lwgeom_parser_result_init(&p);
rv = lwgeom_parse_wkt(&p, wkt, LW_PARSER_CHECK_ALL);
CU_ASSERT_EQUAL( rv, LW_SUCCESS );

lwgeom_parser_result_free(&p);
}

/*
** Used by test harness to register the tests in this file.
*/
@@ -368,4 +402,5 @@ void wkt_in_suite_setup(void)
PG_ADD_TEST(suite, test_wkt_in_tin);
PG_ADD_TEST(suite, test_wkt_in_polyhedralsurface);
PG_ADD_TEST(suite, test_wkt_in_errlocation);
}
PG_ADD_TEST(suite, test_wkt_double);
}
Oops, something went wrong.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.