Skip to content

Commit c164548

Browse files
authored
Merge pull request #10 from corybrunson/inf-norm
Added infinity norm test in test-analysis.R
2 parents 0d4e519 + d005f02 commit c164548

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/testthat/test-analysis.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ test_that("norm agrees with integral", {
1515
expect_equal(pl_integrate(pl, p = 2) ^ (1/2), pl_norm(pl, p = 2))
1616
# 3-norm
1717
expect_equal(pl_integrate(pl, p = 3) ^ (1/3), pl_norm(pl, p = 3))
18-
# inf-norm?
18+
# inf-norm
19+
expect_equal(pl_vmax(pl_abs(pl)), pl_norm(pl, p = Inf))
1920
})
2021

2122
# tinier example
@@ -29,7 +30,8 @@ test_that("distance agrees with integral of difference", {
2930
expect_equal(pl_integrate(pl - pl2, p = 2)^(1/2), pl_distance(pl, pl2, p = 2))
3031
# 3-norm
3132
expect_equal(pl_integrate(pl - pl2, p = 3)^(1/3), pl_distance(pl, pl2, p = 3))
32-
# inf-norm?
33+
# inf-norm
34+
expect_equal(pl_vmax(pl_abs(pl - pl2)), pl_distance(pl, pl2, p = Inf))
3335
})
3436

3537
# TODO: example with non-nested levels

0 commit comments

Comments
 (0)