Skip to content

Commit

Permalink
test MappedByteArray 'supported' method
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Nov 30, 2010
1 parent a3c44ca commit e891531
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion t/pmc/mappedbytearray.t
Expand Up @@ -17,9 +17,24 @@ Tests the MappedByteArray PMC.

.sub main :main
.include 'test_more.pir'
plan(2)
.const int inittests = 3
.const int moretests = 1
.local int alltests
alltests = inittests + moretests
plan(alltests)

test_init()
.local int supported
supported = test_supported()

if supported goto more
skip(moretests, "Mapped files not supported in this platform")
goto end

more:
ok(1, "Mapped files are supported")

end:
.end

# Basic tests, must pass even when mapped files are not supported.
Expand All @@ -37,6 +52,16 @@ Tests the MappedByteArray PMC.
ok(r, 'get_bool gives false when unopened')
.end

# Test the 'supported' method and return its result.
.sub test_supported
.local pmc mm
.local int r
mm = new ['MappedByteArray']
r = mm.'supported'()
ok(1, "method 'supported' called")
.return(r)
.end

# Local Variables:
# mode: pir
# fill-column: 100
Expand Down

0 comments on commit e891531

Please sign in to comment.