Skip to content

Commit

Permalink
Improved file writing API and added print_fragment for non-newline pr…
Browse files Browse the repository at this point in the history
…inting
  • Loading branch information
dhanji committed Aug 9, 2012
1 parent 2ec2056 commit 5de1609
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions resources/loop/lang/prelude.loop
Expand Up @@ -4,6 +4,10 @@ print(object) ->
`java.lang.System::out`.println(object.toString()),
object

print_fragment(object) ->
`java.lang.System::out`.write(object.toString()),
object

negate(b) ->
b not true

Expand Down
5 changes: 4 additions & 1 deletion test/loop/confidence/corelib/CorelibConfidenceTest.java
Expand Up @@ -16,8 +16,11 @@ public class CorelibConfidenceTest extends LoopTest {

@Test
public final void simpleFileWrite() throws IOException {
File expected = new File("target/tmptmp.tmp");
expected.delete();
Loop.run("test/loop/confidence/corelib/file_1.loop");

assertTrue(new File("target/tmptmp.tmp").exists());
assertTrue(expected.exists());
expected.deleteOnExit();
}
}

0 comments on commit 5de1609

Please sign in to comment.