Sha256: eff7a09ade4b6aa8057bafb983f476aaffa74c823588524e58343c52dc312ac2

Contents?: true

Size: 883 Bytes

Versions: 47

Compression:

Stored size: 883 Bytes

Contents

source('./square.R')
suppressPackageStartupMessages({ require(testthat) })

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)
})


print("All tests passed!")

Version data entries

47 entries across 47 versions & 1 rubygems

Version Path
trackler-2.0.8.37 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.36 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.35 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.34 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.33 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.32 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.31 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.30 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.29 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.28 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.27 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.26 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.24 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.23 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.22 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.21 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.20 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.19 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.18 tracks/r/exercises/grains/test_grains.R
trackler-2.0.8.17 tracks/r/exercises/grains/test_grains.R