Sha256: 1483cda0965994a11003d636106071035b722d2798f1806506b6d1bde9cf5a44

Contents?: true

Size: 1.02 KB

Versions: 50

Compression:

Stored size: 1.02 KB

Contents

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

test_that("Case 1", {
  expect_equal(sum_of_multiples(c(3,5), 1), 0)
})

test_that("Case 2", {
  expect_equal(sum_of_multiples(c(3,5), 4), 3)
})

test_that("Case 3", {
  expect_equal(sum_of_multiples(c(3,5), 10), 23)
})

test_that("Case 4", {
  expect_equal(sum_of_multiples(c(3,5), 100), 2318)
})

test_that("Case 5", {
  expect_equal(sum_of_multiples(c(3,5), 1000), 233168)
})

test_that("Case 6", {
  expect_equal(sum_of_multiples(c(7,13,17), 20), 51)
})

test_that("Case 7", {
  expect_equal(sum_of_multiples(c(4,6), 15), 30)
})

test_that("Case 8", {
  expect_equal(sum_of_multiples(c(5,6,8), 150), 4419)
})

test_that("Case 9", {
  expect_equal(sum_of_multiples(c(5,25), 51), 275)
})

test_that("Case 10", {
  expect_equal(sum_of_multiples(c(43,47), 10000), 2203160)
})

test_that("Case 11", {
  expect_equal(sum_of_multiples(c(1), 100), 4950)
})

test_that("Case 12", {
  expect_equal(sum_of_multiples(c(), 10000), 0)
})

print("All tests passed!")

Version data entries

50 entries across 50 versions & 1 rubygems

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