Files
wren/test/io/file/open_block.wren
T

18 lines
433 B
Plaintext
Raw Normal View History

2015-09-30 21:13:36 -07:00
import "io" for File
var stash
File.open("test/io/file/open_block.wren") {|file|
System.print(file is File) // expect: true
System.print(file.isOpen) // expect: true
stash = file
}
// Closes after block.
System.print(stash.isOpen) // expect: false
// Returns null.
System.print(File.open("test/io/file/open_block.wren") {|file|}) // expect: null
// TODO: Test a fiber aborting inside the block.
2016-02-20 09:23:42 -08:00
// TODO: Test return value.