Skip to content

Commit

Permalink
fix blanks
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-mcgann committed Mar 5, 2024
1 parent 3286d1d commit da50c77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions pkg/repl/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ func (r *REPL) Eval(line string) error {
r.err = nil
prev := r.Calc.Stack()

line = strings.TrimSpace(line)
if r.EndQuote != "" {
if line == r.EndQuote {
if strings.TrimSpace(line) == r.EndQuote {
r.EndQuote = ""
} else {
r.Calc.Push(line)
Expand Down
2 changes: 1 addition & 1 deletion pkg/repl/repl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func TestQuoteBlanks(t *testing.T) {
repl.Eval("EOF")

have := c.Stack()
want := []string{"1 2 add", "2 3 sub"}
want := []string{"1 2 add", "2 3 sub", "", ""}
if !reflect.DeepEqual(have, want) {
t.Fatalf("\n have: %v \n want: %v", have, want)
}
Expand Down

0 comments on commit da50c77

Please sign in to comment.