File tree Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Expand file tree Collapse file tree 4 files changed +15
-17
lines changed Original file line number Diff line number Diff line change 10
10
fail-fast : false
11
11
matrix :
12
12
version :
13
- - ' 1.0'
14
- - ' 1.1'
13
+ - ' 1.10' # lts
15
14
- ' 1'
16
15
- ' nightly'
17
16
os :
27
26
version : ${{ matrix.version }}
28
27
arch : ${{ matrix.arch }}
29
28
show-versioninfo : true
30
- - uses : actions/cache@v1
31
- env :
32
- cache-name : cache-artifacts
33
- with :
34
- path : ~/.julia/artifacts
35
- key : ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
36
- restore-keys : |
37
- ${{ runner.os }}-test-${{ env.cache-name }}-
38
- ${{ runner.os }}-test-
39
- ${{ runner.os }}-
40
29
- uses : julia-actions/julia-buildpkg@latest
41
30
- uses : julia-actions/julia-runtest@latest
Original file line number Diff line number Diff line change 1
1
name = " ArgCheck"
2
2
uuid = " dce04be8-c92d-5529-be00-80e4d2c0e197"
3
3
license = " MIT"
4
- version = " 2.4.0 "
4
+ version = " 2.4.1 "
5
5
6
6
[compat ]
7
- julia = " 1"
7
+ julia = " 1.10 "
8
8
9
9
[extras ]
10
10
BenchmarkTools = " 6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Original file line number Diff line number Diff line change 80
80
See also [`@check`](@ref).
81
81
"""
82
82
macro argcheck (ex, options... )
83
- check (ex, ArgCheckFlavor (), options... )
83
+ checkmacro (ex, ArgCheckFlavor (), options... )
84
84
end
85
85
86
86
"""
@@ -97,10 +97,13 @@ Usage is as follows:
97
97
See also [`@argcheck`](@ref).
98
98
"""
99
99
macro check (ex, options... )
100
- check (ex, CheckFlavor (), options... )
100
+ checkmacro (ex, CheckFlavor (), options... )
101
101
end
102
102
103
- function check (ex, checkflavor, options... )
103
+ function checkmacro (ex, checkflavor, options... )
104
+ if length (options) > 1
105
+ error (" Too many arguments for @check/@argcheck macro" )
106
+ end
104
107
codeflavor = if isexpr (ex, :comparison )
105
108
ComparisonFlavor ()
106
109
elseif isexpr (ex, :call )
Original file line number Diff line number Diff line change 308
308
@test Meta. isexpr (ArgCheck. LABEL_END_CHECK, :meta )
309
309
end
310
310
311
+ @testset " Informative error message at macro eval time for extra arguments #48" begin
312
+ # https://github.com/jw3126/ArgCheck.jl/issues/48
313
+ @test_throws " Too many arguments" @macroexpand ( @argcheck 1 == 1 1.8 " That's good" )
314
+ @test_throws " Too many arguments" @macroexpand ( @argcheck 1 == 2 1.8 " That's good" )
315
+ end
316
+
311
317
end # module
You can’t perform that action at this time.
0 commit comments