From 32dc5d893d0eb610f389a46058258131c77fce11 Mon Sep 17 00:00:00 2001 From: Reno <25192197+singularitti@users.noreply.github.com> Date: Mon, 15 Nov 2021 23:53:15 -0500 Subject: [PATCH] Add "Test addition and subtraction" --- test/arithmetic.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/arithmetic.jl b/test/arithmetic.jl index 4a5c213..8e054d6 100644 --- a/test/arithmetic.jl +++ b/test/arithmetic.jl @@ -14,3 +14,16 @@ end @test a / 2 == EngineeringStress(0.5, 1, 1.5, 2, 2.5, 3) @test 2a / 2 == a end + +@testset "Test addition and subtraction" begin + a = EngineeringStrain(1:6) + b = -EngineeringStrain(1:1:6) + @test a - b == 2a + @test b - a == -2a + @test a + b == EngineeringStrain(zeros(6)) + a = TensorStress(EngineeringStress(1:6)) + b = -TensorStress(EngineeringStress(1:6)) + @test a - b == 2a + @test b - a == -2a + @test a + b == TensorStress(zeros(3, 3)) +end