From c18426b38fd4c7509c0501e6c7c6e5f6278f46a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikl=C3=B3s=20Koren?= Date: Sat, 17 Aug 2024 13:00:00 +0200 Subject: [PATCH] Add test for indirect updating --- test/runtests.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 0b687a6..80953c9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -25,6 +25,16 @@ mult(x, y) = x * y @test (@get y) == 11 end + @testset "Indirect updating" begin + @target a = 1 + @target b = add1(a) + @target c = add1(b) + @test (@get c) == 3 + + @target a = 2 + @test (@get c) == 4 + end + @testset "Function modification" begin @target m = 3 @target n = 4