Skip to content

Commit 2c0b265

Browse files
committed
fix check
1 parent 7edda4e commit 2c0b265

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ To install or update LODA, please follow the [installation instructions](https:/
55
### Bugfixes
66

77
* Fix stuck formula generation
8+
* Fix incorrect check
89

910
## v25.7.13
1011

src/eval/evaluator.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ std::pair<status_t, steps_t> Evaluator::check(const Program &p,
162162
Number out;
163163
for (size_t i = 0; i < expected_seq.size(); i++) {
164164
const int64_t index = i + offset;
165+
// evaluate if no error occurred so far
165166
if (result.first == status_t::OK) {
166167
try {
167168
if (use_inc) {
@@ -192,7 +193,8 @@ std::pair<status_t, steps_t> Evaluator::check(const Program &p,
192193
return result;
193194
}
194195
}
195-
if (out != expected_seq[i]) {
196+
// check the result if the evaluation was successful
197+
if (result.first == status_t::OK && out != expected_seq[i]) {
196198
if (settings.print_as_b_file) {
197199
printb(index, out.to_string() + " -> expected " +
198200
expected_seq[i].to_string());
@@ -201,6 +203,7 @@ std::pair<status_t, steps_t> Evaluator::check(const Program &p,
201203
return result;
202204
}
203205
}
206+
// check the range
204207
if (check_range && !range.check(expected_seq[i])) {
205208
if (settings.print_as_b_file) {
206209
printb(index, expected_seq[i].to_string() + " -> violates " +

0 commit comments

Comments
 (0)