summaryrefslogtreecommitdiff
path: root/internal/repl/repl_test.go
AgeCommit message (Collapse)Author
2026-03-26fix modulePaul Buetow
2026-03-26fix: remove unused variable assignments in test filesPaul Buetow
- internal/repl/repl_test.go: Remove unused state variable assignments - internal/rpn/rpn_test.go: Remove unused result/err variable assignments These changes address golangci-lint 'ineffectual assignment' warnings.
2026-03-25rpn: Add unit test for exact user scenario with x =: incremental assignmentPaul Buetow
2026-03-25rpn: Fix incremental assignment with x =: (take value from stack)Paul Buetow
2026-03-25rpn: Add test for incremental assignment with =: operatorPaul Buetow
2026-03-25rpn: Fix := and =: operators semanticsPaul Buetow
2026-03-25rpn: Fix =: operator pop order for REPL modePaul Buetow
2026-03-25code-quality: Various improvements to code quality and thread safetyPaul Buetow
2026-03-25docs: Add SPDX license headers to all .go source filesPaul Buetow
- Added 'SPDX-License-Identifier: MIT' and 'Copyright (c) 2026 Paul Buetow' headers - Files updated: 24 .go files across cmd/gt/, internal/calculator/, internal/repl/, internal/rpn/ The MIT license from LICENSE file is reflected in all source files.
2026-03-25docs: Add comprehensive Go documentation for REPL functionsPaul Buetow
- Enhanced NewREPL documentation with detailed parameter descriptions - Enhanced RunREPL documentation clarifying it's a convenience wrapper - Improved executor documentation explaining backward compatibility and testing usage - Enhanced defaultExecutor documentation with input processing details and panic recovery - Enhanced defaultCompleter documentation with tab-completion behavior details - Enhanced defaultGetCommandDescription documentation with command description details - Improved TTYChecker methods (IsTTY, EnsureTTY) documentation - Improved SignalHandler.Start method documentation All exported and non-exported functions in the REPL package now have comprehensive documentation comments that describe their purpose, parameters, and return values.
2026-03-24test: Improve defaultExecutor and defaultCompleter test coveragePaul Buetow
- Add TestDefaultExecutorCodePaths to test all code paths in defaultExecutor - Improve TestDefaultCompleter to test with multiple input prefixes - Add comprehensive test for unknown commands, built-in commands, and edge cases
2026-03-24feat: Add RPN mode, rational number support, and improve REPLPaul Buetow
- Add RPN (Reverse Polish Notation) calculator with stack-based operations - Support precise rational number calculations using *big.Rat - Implement chain of responsibility pattern for command handling - Add auto-completion for built-in commands - Add history persistence with configurable max entries - Support standard operators: +, -, *, /, ^, %, lg, log, ln - Support hyper operators: [+], [-], [*], [/], [^], [%], [lg], [log], [ln] - Support stack manipulation: dup, swap, pop, show - Support variable assignments and management - Add rat mode for switching between float64 and rational calculations - Refactor calculator to return Calculation struct with formatting - Add proper version support (v0.3.0) All changes follow Go best practices with comprehensive test coverage.
2026-03-23Improve test coverage to 81.9% and fix RPN integrationPaul Buetow
- Add comprehensive unit tests for REPL package - Add completer logic tests to cover edge cases - Integrate RPN as fallback in calculator.Parse() - Add ParseRPN function to calculator package - Add tests for RPN fallthrough path The changes bring overall test coverage from ~70% to 81.9%.
2026-03-20cmd/perc: add unit tests with 86% coveragePaul Buetow
- 21 test functions covering version, calc, rpn subcommands - Tests for assignment, percentage calculations, error handling, repl mode - Coverage: runCommand 91.7%, runRPN 100%, printUsage 100%