Reduce unit test debug output and fix -w flag line numbers#299
Merged
Reduce unit test debug output and fix -w flag line numbers#299
Conversation
- Comment out diag() calls in pack_utf8.t, io_read.t, io_layers.t, io_pipe.t, subroutine.t - Add no warnings blocks to lvalue_substr.t and demo.t Note: Some warnings still emit because PerlOnJava warn() goes directly to stderr without checking warning state. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
Add Warnings.warningManager.isWarningEnabled() checks before: - substr: 'substr outside of string' warnings - misc: 'Odd number of elements' warnings - uninitialized: 'Use of uninitialized value' warnings Files changed: - Operator.java: substr, repeat warnings - RuntimeSubstrLvalue.java: substr warnings - RuntimeHash.java: odd elements warnings - StringOperators.java: concatenation, join warnings - MathOperators.java: multiplication, division, exponentiation warnings Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
Replace string-based isWarningEnabled("category") calls with int-based
isWarningEnabled(ScopedSymbolTable.WARN_*) calls for O(1) BitSet lookup.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <noreply@cognition.ai>
After 'use warnings;' was parsed and its import method executed, the
warning flags were being enabled in a nested scope but lost when
parsing continued due to scope popping.
Fix: After calling the import method, copy the current warning flags
to ALL levels of the parser's symbol table's warning flags stack.
This ensures warning state is preserved when scopes are exited.
Also simplified initializeEnabledWarnings() to just call enableWarning('all')
and changed HashSet to TreeSet for consistent bit position ordering.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <noreply@cognition.ai>
1. Add check for $^W (global warning flag from -w) in isWarningEnabled() so that -w command line flag properly enables all warnings at runtime. 2. Fix multiply() fast path skipping uninitialized value warnings. Check for UNDEF type before the INTEGER fast path to ensure warnings are emitted even when one argument is undef and the other is an int. Fixes assignwarn.t (116/116 now pass). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
When exit() was called inside a sort comparator block, PerlExitException was being caught and wrapped in RuntimeException, preventing Main.main() from catching it properly. This caused the exception to be printed as an error instead of cleanly exiting. Fix: Add explicit catch for PerlExitException in ListOperators.sort() that re-throws without wrapping. Fixes op/runlevel.t test 17 (exit inside sort block), restoring test count from 9/24 to 10/24. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
no warningsblocks for expected warningsNote: Some runtime warnings still emit because PerlOnJava's warn() goes directly to stderr without checking warning state.
Generated with Devin