tests/testthat/test_wasm.R

context("WASM")

test_that("Load WASM program", {
  instance <- wasm(system.file('wasm/add.wasm', package = 'V8'))
  expect_equal(names(instance$exports), 'add')
  expect_equal(instance$exports$add(12, 30), 42)
})

Try the V8 package in your browser

Any scripts or data that you put into this service are public.

V8 documentation built on Oct. 12, 2024, 5:06 p.m.