Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jlangch committed Oct 17, 2023
1 parent 64a2ca5 commit f2063a9
Showing 1 changed file with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public void test_io_buffered_reader() {
final Venice venice = new Venice();

final String script =
"(do " +
" (import :java.io.FileInputStream) " +
" (let [file (io/temp-file \"test-\", \".txt\")] " +
" (io/delete-file-on-exit file) " +
" (io/spit file \"100\n200\" :append false) " +
" (try-with [rd (io/buffered-reader file :encoding :utf-8)] " +
"(do \n" +
" (import :java.io.FileInputStream) \n" +
" (let [file (io/temp-file \"test-\", \".txt\")] \n" +
" (io/delete-file-on-exit file) \n" +
" (io/spit file \"100\n200\" :append false) \n" +
" (try-with [rd (io/buffered-reader file :encoding :utf-8)] \n" +
" (pr-str [(read-line rd) (read-line rd)])))) ";

assertEquals("[\"100\" \"200\"]",venice.eval(script));
Expand All @@ -51,14 +51,14 @@ public void test_io_buffered_writer() {
final Venice venice = new Venice();

final String script =
"(do " +
" (import :java.io.FileInputStream) " +
" (let [file (io/temp-file \"test-\", \".txt\")] " +
" (io/delete-file-on-exit file) " +
" (try-with [wr (io/buffered-writer file)] " +
" (println wr \"100\") " +
" (println wr \"200\")) " +
" (try-with [rd (io/buffered-reader file :encoding :utf-8)] " +
"(do \n" +
" (import :java.io.FileInputStream) \n" +
" (let [file (io/temp-file \"test-\", \".txt\")] \n" +
" (io/delete-file-on-exit file) \n" +
" (try-with [wr (io/buffered-writer file)] \n" +
" (println wr \"100\") \n" +
" (println wr \"200\")) \n" +
" (try-with [rd (io/buffered-reader file :encoding :utf-8)] \n" +
" (pr-str [(read-line rd) (read-line rd)])))) ";

assertEquals("[\"100\" \"200\"]",venice.eval(script));
Expand Down

0 comments on commit f2063a9

Please sign in to comment.