Commit 0bc071a
committed
Test: Don't change scope kind in
This was part of #56509, but is an independent bugfix. The basic
issue is that these macro were using `do` block internally. This
is undesirable for test macros, because we would like them not to
affect the behavior of what they're testing. E.g. right now:
```
julia> using Test
julia> const x = 1
1
julia> @test_nowarn const x = 1
ERROR: syntax: `global const` declaration not allowed inside function around /home/keno/julia/usr/share/julia/stdlib/v1.12/Test/src/Test.jl:927
Stacktrace:
[1] top-level scope
@ REPL[3]:1
```
This PR just writes out the try/finally manually, so the above
works fine after this PR.test_{warn,nowarn}
1 parent afdba95 commit 0bc071a
1 file changed
+19
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
897 | 904 | | |
898 | 905 | | |
899 | 906 | | |
| |||
922 | 929 | | |
923 | 930 | | |
924 | 931 | | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
929 | 940 | | |
930 | 941 | | |
931 | 942 | | |
| |||
0 commit comments