diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-26 09:46:26 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-26 09:46:26 +0200 |
| commit | b0f6b552ed0690e3fad98e9771bbd6a47fbc2e37 (patch) | |
| tree | b76762e50de49436cbe856d5714e640786abf059 /internal/repl/repl_test.go | |
| parent | 0bf0381232019fbda419447166d021d8e0852317 (diff) | |
fix: remove unused variable assignments in test files
- 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.
Diffstat (limited to 'internal/repl/repl_test.go')
| -rw-r--r-- | internal/repl/repl_test.go | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/internal/repl/repl_test.go b/internal/repl/repl_test.go index bf5af49..613bc36 100644 --- a/internal/repl/repl_test.go +++ b/internal/repl/repl_test.go @@ -671,12 +671,11 @@ func TestExecutorWithIncrementalAssignment(t *testing.T) { // Test that assignment works after a calculation with separate commands // This should use the value from the stack for assignment executor("1 2 +") - state := getRPNState() // Now use z =: to assign the top of stack (3) to variable z executor("z =:") - state = getRPNState() - val, exists := state.vars.GetVariable("z") + + val, exists := getRPNState().vars.GetVariable("z") if !exists { t.Errorf("Variable z should exist after z =:") } @@ -689,12 +688,10 @@ func TestExecutorWithIncrementalAssignment(t *testing.T) { func TestExecutorWithSimpleIncrementalAssignment(t *testing.T) { // First execute 2 to put it on the stack executor("2") - state := getRPNState() // Then use x =: to assign the top of stack to variable x executor("x =:") - state = getRPNState() - val, exists := state.vars.GetVariable("x") + val, exists := getRPNState().vars.GetVariable("x") if !exists { t.Errorf("Variable x should exist after x =:") } @@ -711,14 +708,12 @@ func TestExecutorWithExactUserScenario(t *testing.T) { // The variable should be assigned the value 2 executor("2") - state := getRPNState() // Verify stack has 2 // (can't directly check stack without exposing it, but next command will fail if stack is empty) executor("x =:") - state = getRPNState() - val, exists := state.vars.GetVariable("x") + val, exists := getRPNState().vars.GetVariable("x") if !exists { t.Errorf("Variable x should exist after x =:") } |
