summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/textual.cc3
-rw-r--r--test/regress/1182_1.test12
-rw-r--r--test/regress/1182_2.test17
3 files changed, 32 insertions, 0 deletions
diff --git a/src/textual.cc b/src/textual.cc
index 456ff8af..a69c635b 100644
--- a/src/textual.cc
+++ b/src/textual.cc
@@ -563,6 +563,9 @@ void instance_t::automated_xact_directive(char * line)
expr_t::ptr_op_t expr =
query.parse_args(string_value(skip_ws(line + 1)).to_sequence(),
keeper, false, true);
+ if (!expr) {
+ throw parse_error(_("Expected predicate after '='"));
+ }
unique_ptr<auto_xact_t> ae(new auto_xact_t(predicate_t(expr, keeper)));
ae->pos = position_t();
diff --git a/test/regress/1182_1.test b/test/regress/1182_1.test
new file mode 100644
index 00000000..e9c399e6
--- /dev/null
+++ b/test/regress/1182_1.test
@@ -0,0 +1,12 @@
+=
+2000/01/01 Test
+ A $1.00
+ B
+
+test bal -> 1
+__ERROR__
+While parsing file "$FILE", line 1:
+While parsing automated transaction:
+> =
+Error: Expected predicate after '='
+end test
diff --git a/test/regress/1182_2.test b/test/regress/1182_2.test
new file mode 100644
index 00000000..d3c88dd8
--- /dev/null
+++ b/test/regress/1182_2.test
@@ -0,0 +1,17 @@
+2000/01/01 Test
+ A $1.00
+ B
+
+============
+
+2000/01/02 Test
+ A $1.00
+ B
+
+test bal -> 1
+__ERROR__
+While parsing file "$FILE", line 5:
+While parsing automated transaction:
+> ============
+Error: Expected predicate after '='
+end test