Skip to content

Commit

Permalink
rojom
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Dec 11, 2024
1 parent 3c8e63c commit 4cf794b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/aux.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@ function test_ok(str)
character(100) :: test_ok
test_ok = fg_color_green // "OK: " // str // style_reset
end function

function test_notok(str)
use stdlib_ansi, only: fg_color_red, style_reset, operator(//)
character(*), intent(in) :: str
character(100) :: test_notok
test_notok = fg_color_red // "ERROR: " // str // style_reset
end function

subroutine assert(expr, test_name)
logical, intent(in) :: expr
character(*), intent(in) :: test_name
if (.not. expr) then
error stop "ERROR: " // test_name
error stop test_notok(test_name)
else
print *, test_ok(test_name)
end if
Expand Down

0 comments on commit 4cf794b

Please sign in to comment.