summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-05 22:00:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-05 22:00:43 +0000
commitf3be555096b0b64917d27578e51c9e6c7d9c7083 (patch)
tree8f237a3f00196bdb636db65a463ab0e7936f5b5a /xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
parent406b23d9350777514e499cefdc080212de596e8d (diff)
downloadpdfium-f3be555096b0b64917d27578e51c9e6c7d9c7083.tar.xz
[formcalc] Simplify function signature parsingchromium/3363
This CL refactors the signature parsing for formcalc functions. Change-Id: I69634968ab1cbd9698a3ce3ae321e14bafe918c6 Reviewed-on: https://pdfium-review.googlesource.com/27930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp')
-rw-r--r--xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
index d1e5919324..52de964f65 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
@@ -206,3 +206,15 @@ TEST(CXFA_FMParserTest, ParseFuncWithoutParams) {
EXPECT_TRUE(ast->ToJavaScript(buf));
EXPECT_EQ(ret, buf.AsStringView());
}
+
+TEST(CXFA_FMParserTest, ParseFuncWithBadParamsList) {
+ const wchar_t input[] = {
+ L"func MyFunction(param1,) do\n"
+ L" param1 * param2\n"
+ L"endfunc"};
+
+ auto parser = pdfium::MakeUnique<CXFA_FMParser>(input);
+ std::unique_ptr<CXFA_FMAST> ast = parser->Parse();
+ ASSERT_TRUE(ast == nullptr);
+ EXPECT_TRUE(parser->HasError());
+}