From 1b393d13f1d02d1300ced282ed194ecc65f2d22b Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Sun, 26 Apr 2020 22:59:01 +0200 Subject: [PATCH] add test --- src/args.jl | 4 ++-- src/pipeline.jl | 4 ++-- test/test_pgfplotsx.jl | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/args.jl b/src/args.jl index 69e9f6f7..5c39de57 100644 --- a/src/args.jl +++ b/src/args.jl @@ -656,7 +656,7 @@ function default(k::Symbol) return _axis_defaults_byletter[letter][key] end k == :letter && return k # for type recipe processing - k in _suppress_warnings || error("Unknown key: ", k) + return missing end function default(k::Symbol, v) @@ -1133,7 +1133,7 @@ function warn_on_unsupported_args(pkg::AbstractBackend, plotattributes) k in _suppress_warnings && continue default_value = default(k) if ismissing(default_value) - extra_kwargs[k] = pop!(plotattributes, k) + extra_kwargs[k] = pop_kw!(plotattributes, k) elseif plotattributes[k] != default(k) k in already_warned || push!(_to_warn, k) end diff --git a/src/pipeline.jl b/src/pipeline.jl index e88e96b8..56a5f054 100644 --- a/src/pipeline.jl +++ b/src/pipeline.jl @@ -341,8 +341,8 @@ function _expand_subplot_extrema(sp::Subplot, plotattributes::AKW, st::Symbol) end function _add_the_series(plt, sp, plotattributes) - plt[:extra_kwargs][:series] = warnOnUnsupported_args(plt.backend, plotattributes) - warnOnUnsupported(plt.backend, plotattributes) + plt[:extra_kwargs][:series] = warn_on_unsupported_args(plt.backend, plotattributes) + warn_on_unsupported(plt.backend, plotattributes) series = Series(plotattributes) push!(plt.series_list, series) push!(sp.series_list, series) diff --git a/test/test_pgfplotsx.jl b/test/test_pgfplotsx.jl index a21ed191..99ec4dba 100644 --- a/test/test_pgfplotsx.jl +++ b/test/test_pgfplotsx.jl @@ -326,3 +326,9 @@ end # end end # testset end # testset + +@testset "Extra kwargs" begin + pl = plot(1:5, test = "me") + @test pl.attr[:extra_kwargs][:series][:test] == "me" + +end # testset