-
Notifications
You must be signed in to change notification settings - Fork 12
/
unit_tests.jl
23 lines (17 loc) · 912 Bytes
/
unit_tests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using Test
using SummationByPartsOperators
@testset "DerivativeCoefficientRow" begin
row1 = SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,3}([1,2,3])
row2 = SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,3}([2,4,6])
row3 = SummationByPartsOperators.DerivativeCoefficientRow{Rational,2,3}([2,4,6])
@test -row1 ==
SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,3}([-1,-2,-3])
@test row1 + row2 ==
SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,3}([3,6,9])
@test row1 + row3 ==
SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,4}([1,4,7,6])
@test row1 / 2 ==
SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,3}([1//2, 2//2, 3//2])
@test (row1 + -row3) / 2 ==
SummationByPartsOperators.DerivativeCoefficientRow{Rational,1,4}([1//2, 0, -1//2, -3])
end