Sha256: e024d3b439fbe796155db828e7a7f392848517e9234c7824376538ecb310eefa

Contents?: true

Size: 887 Bytes

Versions: 53

Compression:

Stored size: 887 Bytes

Contents

source("./grains.R")
library(testthat)

context("grains")

test_that("Case 1", {
  expect_equal(square(1), 1)
})

test_that("Case 2", {
  expect_equal(square(2), 2)
})

test_that("Case 3", {
  expect_equal(square(3), 4)
})

test_that("Case 4", {
  expect_equal(square(4), 8)
})

test_that("Case 16", {
  expect_equal(square(16), 32768)
})

test_that("Case 32", {
  expect_equal(square(32), 2147483648)
})

test_that("Case 1", {
  expect_equal(square(64), 9223372036854775808)
})

test_that("square 0 raises an exception", {
  expect_error(square(0))
})

test_that("negative square raises an exception", {
  expect_error(square(-1))
})

test_that("square greater than 64 raises an exception", {
  expect_error(square(65))
})

test_that("returns the total number of square on the board", {
  expect_equal(total(), 18446744073709551615)
})

message("All tests passed for exercise: grains")

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.179 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.178 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.177 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.176 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.175 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.174 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.173 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.172 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.171 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.170 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.169 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.167 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.166 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.165 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.164 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.163 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.162 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.161 tracks/r/exercises/grains/test_grains.R
trackler-2.2.1.160 tracks/r/exercises/grains/test_grains.R