Skip to content

Commit

Permalink
check that slurp works twice in a row. Fix rexx
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Jul 15, 2019
1 parent 6fd3a0d commit 82bc78e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rexx/core.rexx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ mal_readline: procedure expose values. /* mal_readline(prompt) */
return new_nil()

mal_slurp: procedure expose values. /* mal_read_string(filename) */
file_content = charin(obj_val(arg(1)), , 100000)
file_content = charin(obj_val(arg(1)), 1, 100000)
return new_string(file_content)

mal_lt: procedure expose values. /* mal_lt(a, b) */
Expand Down
4 changes: 4 additions & 0 deletions tests/step6_file.mal
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
(slurp "../tests/test.txt")
;=>"A line of text\n"

;;; Load the same file twice.
(slurp "../tests/test.txt")
;=>"A line of text\n"

;; Testing load-file

(load-file "../tests/inc.mal")
Expand Down

0 comments on commit 82bc78e

Please sign in to comment.