Sha256: 759c4a3349c3fed80bea923d541dad2300119e8357458213f04e9eacf73ae095

Contents?: true

Size: 1.03 KB

Versions: 140

Compression:

Stored size: 1.03 KB

Contents

source("./sum-of-multiples.R")
library(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)
})

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

Version data entries

140 entries across 140 versions & 1 rubygems

Version Path
trackler-2.2.1.126 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.125 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.124 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.123 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.122 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.121 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.120 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.119 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.118 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.117 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.116 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.115 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.114 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.113 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.111 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.110 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.109 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.108 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.107 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R
trackler-2.2.1.106 tracks/r/exercises/sum-of-multiples/test_sum-of-multiples.R