From: Ben Pfaff Date: Sat, 25 Jun 2022 03:37:04 +0000 (-0700) Subject: DESCRIPTIVES: Fix bad error message. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=commitdiff_plain;h=99569eac0b20a91a779ab8577c5504af70625dd5 DESCRIPTIVES: Fix bad error message. --- diff --git a/src/language/stats/descriptives.c b/src/language/stats/descriptives.c index c1cbe6f279..160e45610f 100644 --- a/src/language/stats/descriptives.c +++ b/src/language/stats/descriptives.c @@ -474,8 +474,8 @@ match_statistic (struct lexer *lexer) if (lex_match_id (lexer, dsc_info[stat].identifier)) return stat; - lex_get (lexer); lex_error (lexer, _("expecting statistic name: reverting to default")); + lex_get (lexer); } return DSC_NONE; diff --git a/tests/language/stats/descriptives.at b/tests/language/stats/descriptives.at index 7b4d29662c..8a1c26a7d4 100644 --- a/tests/language/stats/descriptives.at +++ b/tests/language/stats/descriptives.at @@ -442,3 +442,21 @@ Valid N (listwise),40,,,, Missing N (listwise),0,,,, ]) AT_CLEANUP + +dnl Check for regression for a bad error message that cited the +dnl token following the bad statistic name. +AT_SETUP([DESCRIPTIVES -- negative]) +AT_DATA([descriptives.sps], [dnl +DATA LIST NOTABLE/V0 to V16 1-17. +BEGIN DATA. +12128989012389023 +END DATA. +DESCRIPTIVES ALL/STATISTICS=COUNT MEAN. +]) +AT_CHECK([pspp descriptives.sps], [1], [dnl +descriptives.sps:5.29-5.33: error: DESCRIPTIVES: Syntax error at `COUNT': +expecting statistic name: reverting to default. + +descriptives.sps:5.35-5.38: error: DESCRIPTIVES: Syntax error at `MEAN'. +]) +AT_CLEANUP