Bug #10356
Invalid logical value: should throw error instead of warning
100%
History
#1 Updated by Teodor Gorghe 12 months ago
Using invalid logical literal constructor should throw error.
The following test case illustrates the behavior on 4GL:
#3 Updated by Constantin Asofiei 12 months ago
Teodor, I don't understand the test.
In a simple .p, the behavior is this:
// block-level on error undo, throw.
DO ON ERROR UNDO, LEAVE:
LOGICAL("Invalid logical").
message "this is reached".
END.
message "this is reached also".
with and without the
block-level statement.#4 Updated by Teodor Gorghe 12 months ago
Constantin Asofiei wrote:
Teodor, I don't understand the test.
In a simple .p, the behavior is this:
[...]
with and without theblock-levelstatement.
This is not a problem on FWD this aspect, it works. The only problem is the first test.
That RETURN statement exits the method and the Assert:IsTrue(FALSE). is not executed.
#5 Updated by Teodor Gorghe 12 months ago
- Assignee set to Teodor Gorghe
- Status changed from New to WIP
Created task branch 10356a.
#6 Updated by Teodor Gorghe 12 months ago
- % Done changed from 0 to 100
- Status changed from WIP to Review
- reviewer Constantin Asofiei added
Committed revision 16082 on task branch 10356a:
- Fix logical with invalid string literal to throw an error instead of warning.
#7 Updated by Constantin Asofiei 12 months ago
Why is asMsg made true - this will not add the ** prefix to the error message.
How does this test work with your change?
block-level on error undo, throw.
DO ON ERROR UNDO, LEAVE:
LOGICAL("Invalid logical").
message "this is reached".
END.
message "this is reached also".
#8 Updated by Teodor Gorghe 12 months ago
The output is the following:
Input value: Invalid logical should be yes/no this is reached // Press enter this is reached also
I think I need to change msg back to be false.
#9 Updated by Teodor Gorghe 12 months ago
Committed revision 16083 on task branch 10356a:
- fix logical error message.
The output becomes:
** Input value: Invalid logical should be yes/no. (87) this is reached // Press enter this is reached also
#10 Updated by Teodor Gorghe 12 months ago
Test results after changes:
╷
├─ JUnit Jupiter ✔
├─ JUnit Vintage ✔
├─ JUnit Platform Suite ✔
└─ FWD Test ✔
└─ tests.TestInvalidLogical ✔
├─ invalidLogical ✔
├─ invalidLogicalDoBlock ✔
└─ invalidLogicalCatchBlock ✔
#11 Updated by Constantin Asofiei 12 months ago
- Status changed from Review to Internal Test
Please put this into testing.
#12 Updated by Alexandru Lungu 12 months ago
- Status changed from Internal Test to Merge Pending
Please merge 10356a to trunk after 10336a.
#13 Updated by Teodor Gorghe 12 months ago
- Status changed from Merge Pending to Internal Test
Branch 10356a was merged to trunk rev 16098 and archived.
#14 Updated by Teodor Gorghe 12 months ago
- Status changed from Internal Test to Test