Sha256: 1ecb2a39f8306e4d9ed5609fe39f16c88aceb72e803ab3803a46efa67738d6ce

Contents?: true

Size: 1.05 KB

Versions: 53

Compression:

Stored size: 1.05 KB

Contents

source("./sum-of-multiples.R")
library(testthat)

context("sum of multiples")

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

message("All tests passed for exercise: sum-of-multiples")

Version data entries

53 entries across 53 versions & 1 rubygems

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