diff --git a/src/GMT.jl b/src/GMT.jl index 898238b59..72123176e 100644 --- a/src/GMT.jl +++ b/src/GMT.jl @@ -202,6 +202,8 @@ export Date, DateTime, Year, Month, Week, Day, Hour, Minute, Second, year, month, week, day, hour, minute, second, now, today, bissextile, + prettytable, + @?, @G, @dir include("common_docs.jl") diff --git a/src/PrettyTables.jl b/src/PrettyTables.jl index 3ff42cdac..bfb35c5a2 100644 --- a/src/PrettyTables.jl +++ b/src/PrettyTables.jl @@ -7,7 +7,7 @@ # and no longer need a > 10 MB PT precomp cache DLL. ############################################################################################ -export pretty_table +#export pretty_table #const _REGEX_ANSI_SEQUENCES = r"\x1B(?:]8;;[^\x1B]*\x1B\\|[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])" @@ -294,6 +294,8 @@ function pretty_table(@nospecialize(io::IO), @nospecialize(data::Any); header::U return _print_table(io, pdata; header = pheader, kwargs...) end +const prettytable = pretty_table # Alias + # -------------------------------------------------------------------------------- @kwdef struct TextFormat up_right_corner::Char = '┐' @@ -1040,13 +1042,7 @@ function _check_hline(ptable::ProcessedTable, hlines::Vector{Int}, body_hlines:: end function _check_hline(ptable::ProcessedTable, hlines::Symbol, body_hlines::AbstractVector, i::Int) - if hlines == :all - return true - elseif hlines == :none - return _check_hline(ptable, Int[], body_hlines, i) - else - error("`hlines` must be `:all`, `:none`, or a vector of integers.") - end + return (hlines == :all) ? true : (hlines == :none) ? _check_hline(ptable, Int[], body_hlines, i) : error("`hlines` must be `:all`, `:none`, or a vector of integers.") end function _check_vline(ptable::ProcessedTable, vlines::AbstractVector, j::Int) @@ -1064,13 +1060,7 @@ function _check_vline(ptable::ProcessedTable, vlines::AbstractVector, j::Int) end function _check_vline(ptable::ProcessedTable, vlines::Symbol, j::Int) - if vlines == :all - return true - elseif vlines == :none - return false - else - error("`vlines` must be `:all`, `:none`, or a vector of integers.") - end + return (vlines == :all) ? true : (vlines == :none) ? false : error("`vlines` must be `:all`, `:none`, or a vector of integers.") end function _count_hlines(ptable::ProcessedTable, hlines::Vector{Int}, body_hlines::Vector{Int}) @@ -2551,8 +2541,7 @@ function _print_custom_text_cell!(display::Display, cell_data::CustomTextCell, c # Write it to the display. _write_to_display!(display, rendered_str, suffix, new_lstr + textwidth(suffix)) - # Print the padding character after the cell and return if the display has reached - # end-of-line. + # Print the padding character after the cell and return if the display has reached end-of-line. return _p!(display, " ", false, 1) end @@ -2805,9 +2794,8 @@ function ProcessedTable(data::Any, header::Any; elseif show_header num_header_columns = length(first(header)) - if num_data_columns != num_header_columns + (num_data_columns != num_header_columns) && error("The number of columns in the header ($num_header_columns) must be equal to that of the table ($num_data_columns).") - end num_header_rows = show_subheader ? length(header) : 1 end diff --git a/src/proj_utils.jl b/src/proj_utils.jl index c27f1e6f9..f8f24d371 100644 --- a/src/proj_utils.jl +++ b/src/proj_utils.jl @@ -1016,9 +1016,9 @@ function helper_geoglimits(prj::String, region::Vector{Float64})::Vector{Float64 Gdal.CPLPushErrorHandler(@cfunction(Gdal.CPLQuietErrorHandler, Cvoid, (UInt32, Cint, Cstring))) opts = ["-s_srs", prj, "-t_srs", prj4WGS84, "-overwrite"] ds = Gdal.get_gdaldataset([region[1] region[3]], opts, false)[1] - o1 = Gdal.gdalvectortranslate(ds, opts; dest="/vsimem/tmp", gdataset=true) + o1 = Gdal.gdalvectortranslate(ds, opts; dest="/vsimem/tmp", gdataset=true)::GMT.Gdal.IDataset ds = Gdal.get_gdaldataset([region[2] region[4]], opts, false)[1] - o2 = Gdal.gdalvectortranslate(ds, opts; dest="/vsimem/tmp", gdataset=true) + o2 = Gdal.gdalvectortranslate(ds, opts; dest="/vsimem/tmp", gdataset=true)::GMT.Gdal.IDataset if (o1.ptr == C_NULL || o2.ptr == C_NULL) # Diagonals failed, probably a Mollweide or alike projection t = xy2lonlat([region[1] min(0,region[4]); region[2] min(0,region[4]); 0 region; 0 region], s_srs=prj, t_srs=prj4WGS84) diff --git a/src/spatial_funs.jl b/src/spatial_funs.jl index 40ad5d5be..4f9b4165f 100644 --- a/src/spatial_funs.jl +++ b/src/spatial_funs.jl @@ -346,6 +346,7 @@ end See `? getbyattrib` """ Base.:filter(D::Vector{<:GMTdataset}; kw...) = getbyattrib(D; kw...) + # --------------------------------------------------------------------------------------------------- """ findall(D::Vector{<:GMTdataset}; kw...) diff --git a/src/utils_types.jl b/src/utils_types.jl index 9e3982c46..8d9a1217c 100644 --- a/src/utils_types.jl +++ b/src/utils_types.jl @@ -67,8 +67,9 @@ does not need explicit coordinates to place the text. - `segnan` or `nanseg`: Boolean. If true make a multi-segment made out of segments separated by NaNs. - `datatype`: Keep the original data type of `mat`. Default converts to Float64. - `geom`: The data geometry. By default, we set `wkbUnknown` but try to do some basic guess. - - `proj` or `proj4`: A proj4 string for dataset SRS. - - `wkt`: A WKT SRS. + - `proj` or `proj4`: A proj4 string for dataset SRS. Default is empty. To set it to lon,lat in WGS84 use ``proj=prj4WGS84`` + - `wkt`: A WKT SRS string. + - `epsg`: An integer EPSG code. _e.g._ ``epsg=4326`` for lon,lat in WGS84. Default is 0. - `colnames`: Optional string vector with names for each column of `mat`. - `attrib`: Optional dictionary{String, String} with attributes of this dataset. - `ref:` Pass in a reference GMTdataset from which we'll take the georeference info as well as `attrib` and `colnames` diff --git a/test/test_PT_alignments.jl b/test/test_PT_alignments.jl index 93fc25ab3..4b6ec7d7b 100644 --- a/test/test_PT_alignments.jl +++ b/test/test_PT_alignments.jl @@ -26,7 +26,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data; alignment = :l) + result = prettytable(String, data; alignment = :l) @test result == expected # == Center ============================================================================ @@ -42,7 +42,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data; alignment = :c) + result = prettytable(String, data; alignment = :c) @test result == expected # == Per Column Configuration ========================================================== @@ -59,7 +59,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data; alignment = [:l, :r, :c, :r]) + result = prettytable(String, data; alignment = [:l, :r, :c, :r]) @test result == expected # == Cell Override ===================================================================== @@ -76,7 +76,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; alignment = [:l, :r, :c, :r], @@ -110,7 +110,7 @@ data = Any[1 false 1.0 0x01 ; └───────────┴───────────┴───────────┴───────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -142,7 +142,7 @@ data = Any[1 false 1.0 0x01 ; └───────────┴───────────┴───────────┴───────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, alignment = [:l, :r, :c, :r], @@ -183,7 +183,7 @@ end └────────────┴────────────┴──────────────┴──────────────┴────────────────┴────────────────┴────────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\."]) @@ -191,7 +191,7 @@ end @test result == expected - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(i => [r"\."] for i in 1:7) @@ -213,7 +213,7 @@ end └───────────┴───────────┴─────────────┴─────────────┴───────────────┴───────────────┴───────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\.", r"^"]) @@ -237,7 +237,7 @@ end └─────┴─────────┴─────────┴─────────┴─────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix, alignment_anchor_regex = Dict(4 => [r"\.", r"^"]), @@ -260,7 +260,7 @@ end └─────┴───┴─────────┴─────────┴─────────┴─────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix, alignment_anchor_regex = Dict(4 => [r"\.", r"^"]), @@ -286,7 +286,7 @@ end └─────────┴─────────┴─────────┴──────────────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(4 => [r"\.", r"^"]), @@ -309,7 +309,7 @@ end └─────────┴─────────┴─────────┴──────────────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment = :c, @@ -333,7 +333,7 @@ end └─────────┴─────────┴─────────┴──────────────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment = :l, @@ -359,7 +359,7 @@ end └─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┴─────────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(4 => [r"\.", r"^"]), @@ -382,7 +382,7 @@ end └─────────┴─────────┴─────────┴────────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(4 => [r"\.", r"^"]), @@ -407,7 +407,7 @@ end └──────────┴──────────┴───────────┴──────────┴────────────┴────────────┴────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(i => [r"\."] for i in 1:7), @@ -430,7 +430,7 @@ end └──────────────┴──────────────┴──────────────┴─────────────┴────────────┴───────────┴─────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(i => [r"\."] for i in 1:7), @@ -453,7 +453,7 @@ end └────────────┴──────────┴──────────────┴─────────────┴────────────────┴────────────────┴────────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\."]), @@ -476,7 +476,7 @@ end └──────────┴──────────┴───────────┴─────────────┴────────────────┴────────────┴────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\."]), @@ -502,7 +502,7 @@ end └─────┴──────────┴──────────┴───────────┴─────────────┴────────────────┴────────────┴────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\."]), @@ -527,7 +527,7 @@ end └───────┴──────────┴──────────┴───────────┴─────────────┴────────────────┴────────────┴────────────┘ """ - result = pretty_table( + result = prettytable( String, matrix; alignment_anchor_regex = Dict(0 => [r"\."]), diff --git a/test/test_PT_column_width.jl b/test/test_PT_column_width.jl index 38478b1a4..50f6cce10 100644 --- a/test/test_PT_column_width.jl +++ b/test/test_PT_column_width.jl @@ -30,7 +30,7 @@ data = Any[1 false 1.0 0x01 ; └──────┴───────┴──────┴──────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -53,7 +53,7 @@ data = Any[1 false 1.0 0x01 ; └────┴────┴────┴────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -77,7 +77,7 @@ data = Any[1 false 1.0 0x01 ; └────┴───────┴────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -100,7 +100,7 @@ data = Any[1 false 1.0 0x01 ; └──────────┴──────────┴──────────┴──────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -124,7 +124,7 @@ data = Any[1 false 1.0 0x01 ; └───┴─────┴─────┴───┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -147,7 +147,7 @@ data = Any[1 false 1.0 0x01 ; └───┴────┴─────┴──────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -171,7 +171,7 @@ data = Any[1 false 1.0 0x01 ; └───┴─────┴────┴───┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, @@ -194,7 +194,7 @@ data = Any[1 false 1.0 0x01 ; └─────┴─────┴─────┴─────┘ """ - result = pretty_table( + result = prettytable( String, data; header = header, diff --git a/test/test_PT_default.jl b/test/test_PT_default.jl index e7c5ce11b..827700785 100644 --- a/test/test_PT_default.jl +++ b/test/test_PT_default.jl @@ -25,7 +25,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data) + result = prettytable(String, data) @test result == expected # Without a newline at end. @@ -41,7 +41,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘""" - result = pretty_table(String, data, newline_at_end = false) + result = prettytable(String, data, newline_at_end = false) @test result == expected end @@ -68,7 +68,7 @@ data = Any[1 false 1.0 0x01 ; : 6 : true : 6.0 : 6 : :........:........:........:........: """ - result = pretty_table(String, data, tf = GMT.tf_ascii_dots) + result = prettytable(String, data, tf = GMT.tf_ascii_dots) @test result == expected # == ascii_rounded ===================================================================== @@ -85,7 +85,7 @@ data = Any[1 false 1.0 0x01 ; | 6 | true | 6.0 | 6 | '--------'--------'--------'--------' """ - result = pretty_table(String, data, tf = GMT.tf_ascii_rounded) + result = prettytable(String, data, tf = GMT.tf_ascii_rounded) @test result == expected # == borderless ======================================================================== @@ -100,7 +100,7 @@ data = Any[1 false 1.0 0x01 ; 5 false 5.0 5 6 true 6.0 6 """ - result = pretty_table(String, data, tf = GMT.tf_borderless) + result = prettytable(String, data, tf = GMT.tf_borderless) @test result == expected # == compact =========================================================================== @@ -117,7 +117,7 @@ data = Any[1 false 1.0 0x01 ; 6 true 6.0 6 -------- -------- -------- -------- """ - result = pretty_table(String, data, tf = GMT.tf_compact) + result = prettytable(String, data, tf = GMT.tf_compact) @test result == expected # == matrix ============================================================================ @@ -132,7 +132,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 true 6.0 6 │ └ ┘ """ - result = pretty_table(String, data, tf = GMT.tf_matrix, show_header = false) + result = prettytable(String, data, tf = GMT.tf_matrix, show_header = false) @test result == expected # == simple ============================================================================ @@ -149,7 +149,7 @@ data = Any[1 false 1.0 0x01 ; 6 true 6.0 6 ========= ======== ======== ========= """ - result = pretty_table(String, data, tf = GMT.tf_simple) + result = prettytable(String, data, tf = GMT.tf_simple) @test result == expected # == unicode_rounded =================================================================== @@ -166,7 +166,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ ╰────────┴────────┴────────┴────────╯ """ - result = pretty_table(String, data, tf = GMT.tf_unicode_rounded) + result = prettytable(String, data, tf = GMT.tf_unicode_rounded) @test result == expected # == Custom formats ==================================================================== @@ -183,7 +183,7 @@ data = Any[1 false 1.0 0x01 ; """ tf = GMT.TextFormat(hlines = [:header]) - result = pretty_table(String, data, tf = tf) + result = prettytable(String, data, tf = tf) @test result == expected expected = """ @@ -199,7 +199,7 @@ data = Any[1 false 1.0 0x01 ; """ tf = GMT.TextFormat(hlines = [:begin,:end]) - result = pretty_table(String, data, tf = tf) + result = prettytable(String, data, tf = tf) @test result == expected end @@ -227,7 +227,7 @@ end └───────┴────────┘ """ - result = pretty_table(String, dict, sortkeys = true) + result = prettytable(String, dict, sortkeys = true) @test result == expected end @@ -253,7 +253,7 @@ end └────────┘ """ - result = pretty_table(String, vec) + result = prettytable(String, vec) @test result == expected expected = """ @@ -274,7 +274,7 @@ end └─────┴────────┘ """ - result = pretty_table(String, vec; alignment = :c, show_row_number = true) + result = prettytable(String, vec; alignment = :c, show_row_number = true) @test result == expected expected = """ @@ -296,10 +296,10 @@ end └────────────┘ """ - result = pretty_table(String, vec; header = (["Header"], ["Sub-header"])) + result = prettytable(String, vec; header = (["Header"], ["Sub-header"])) @test result == expected - @test_throws Exception pretty_table( vec; header = ["1", "1"]) + @test_throws Exception prettytable( vec; header = ["1", "1"]) end @testset "Print missing, nothing, and #undef" begin @@ -320,7 +320,7 @@ end └─────────┴─────────┴────────┘ """ - result = pretty_table(String, matrix) + result = prettytable(String, matrix) @test result == expected end @@ -332,7 +332,7 @@ data = Any[1 false 1.0 0x01 ; 5 false 5.0 0x05 ; 6 true 6.0 0x06 ;] - result = pretty_table( + result = prettytable( String, data; header = (["A", "B", "C", "D"], ["E", "F", "G", "H"]), @@ -342,7 +342,7 @@ data = Any[1 false 1.0 0x01 ; num_lines = length(findall(x->x == '\n', result)) io = IOBuffer() - pretty_table( + prettytable( io, data; header = (["A", "B", "C", "D"], ["E", "F", "G", "H"]), diff --git a/test/test_PT_line_breaks.jl b/test/test_PT_line_breaks.jl index b93617535..b9c664342 100644 --- a/test/test_PT_line_breaks.jl +++ b/test/test_PT_line_breaks.jl @@ -25,7 +25,7 @@ └─────────────────────────────┴───────┘ """ - result = pretty_table(String, data; header = header, linebreaks = true) + result = prettytable(String, data; header = header, linebreaks = true) @test result == expected expected = """ @@ -42,7 +42,7 @@ └─────────────────────────────┴───────┘ """ - result = pretty_table( String, data; header = header, alignment = :c, linebreaks = true) + result = prettytable( String, data; header = header, alignment = :c, linebreaks = true) @test result == expected expected = """ @@ -59,7 +59,7 @@ └─────────────────────────────┴───────┘ """ - result = pretty_table( String, data; header = header, alignment = :l, linebreaks = true) + result = prettytable( String, data; header = header, alignment = :l, linebreaks = true) @test result == expected expected = """ @@ -72,7 +72,7 @@ └────────────────────────────────────────────────────────────────────┴───────┘ """ - result = pretty_table(String, data; header = header) + result = prettytable(String, data; header = header) @test result == expected # == Show Only the First Line ========================================================== @@ -87,7 +87,7 @@ └────────────────────┴───────┘ """ - result = pretty_table( String, data; header = header, cell_first_line_only = true) + result = prettytable( String, data; header = header, cell_first_line_only = true) @test result == expected end @@ -138,7 +138,7 @@ end └──────────────┴────────────────────────────────┘ """ - result = pretty_table( String, table; header = header, autowrap = true, linebreaks = true, body_hlines = [1, 2], columns_width = [-1, 30]) + result = prettytable( String, table; header = header, autowrap = true, linebreaks = true, body_hlines = [1, 2], columns_width = [-1, 30]) @test result == expected @@ -173,7 +173,7 @@ end └──────────────┴────────────────────────────────┘ """ - result = pretty_table( String, table; header=header, alignment=:c, autowrap=true, linebreaks=true, body_hlines=[1, 2], columns_width=[-1, 30]) + result = prettytable( String, table; header=header, alignment=:c, autowrap=true, linebreaks=true, body_hlines=[1, 2], columns_width=[-1, 30]) @test result == expected @@ -208,7 +208,7 @@ end └──────────────┴────────────────────────────────┘ """ - result = pretty_table( + result = prettytable( String, table; header = header, @@ -254,7 +254,7 @@ end └─────┴──────────┴──────────────┴────────────────────────────────┘ """ - result = pretty_table( + result = prettytable( String, table; header = header, alignment = :l, diff --git a/test/test_PT_row_numbers.jl b/test/test_PT_row_numbers.jl index 4e6d4a70f..5c5d21df2 100644 --- a/test/test_PT_row_numbers.jl +++ b/test/test_PT_row_numbers.jl @@ -25,7 +25,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ 6 │ true │ 6.0 │ 6 │ └─────┴────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; alignment = [:l, :r, :c, :r], @@ -46,7 +46,7 @@ data = Any[1 false 1.0 0x01 ; └─────┴────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; alignment = [:l, :r, :c, :r], @@ -68,6 +68,6 @@ data = Any[1 false 1.0 0x01 ; └───┴────────┴────────┴────────┴────────┘ """ - result = pretty_table( String, data; alignment=[:l, :r, :c, :r], row_number_alignment=:c, row_number_column_title="#", show_row_number=true) + result = prettytable( String, data; alignment=[:l, :r, :c, :r], row_number_alignment=:c, row_number_column_title="#", show_row_number=true) @test result == expected end diff --git a/test/test_PT_table_lines.jl b/test/test_PT_table_lines.jl index 78e7c52b3..add754baf 100644 --- a/test/test_PT_table_lines.jl +++ b/test/test_PT_table_lines.jl @@ -27,7 +27,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; body_hlines = vcat(findall(x->x == true, data[:,2])) @@ -48,7 +48,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; body_hlines = vcat(findall(x -> x == true, data[:, 2])), @@ -68,7 +68,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ └───┴───────┴─────┴───┘ """ - result = pretty_table( + result = prettytable( String, data; show_header = false, @@ -96,7 +96,7 @@ data = Any[1 false 1.0 0x01 ; └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data; hlines = :all) + result = prettytable(String, data; hlines = :all) @test result == expected expected = """ @@ -109,7 +109,7 @@ data = Any[1 false 1.0 0x01 ; │ 6 │ true │ 6.0 │ 6 │ """ - result = pretty_table(String, data; hlines = :none) + result = prettytable(String, data; hlines = :none) @test result == expected end @@ -135,7 +135,7 @@ data = Any[1 false 1.0 0x01 ; ──────────────────────── """ - result1 = pretty_table( + result1 = prettytable( String, data; header = ( @@ -144,7 +144,7 @@ data = Any[1 false 1.0 0x01 ; ), vlines = [] ) - result2 = pretty_table( + result2 = prettytable( String, data; header = ( ["C1", "C2", "C3", "C4"], @@ -169,7 +169,7 @@ data = Any[1 false 1.0 0x01 ; └────────────────────────┘ """ - result1 = pretty_table( + result1 = prettytable( String, data; header = ( @@ -178,7 +178,7 @@ data = Any[1 false 1.0 0x01 ; ), vlines = [:begin, :end] ) - result2 = pretty_table( + result2 = prettytable( String, data; header = ( @@ -204,7 +204,7 @@ data = Any[1 false 1.0 0x01 ; └─────┴────────────────────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = ( @@ -230,7 +230,7 @@ data = Any[1 false 1.0 0x01 ; └─────┴────────────┴────────────────────────┘ """ - result = pretty_table( + result = prettytable( String, data; header = ( @@ -258,7 +258,7 @@ data = Any[1 false 1.0 0x01 ; 2 columns and 3 rows omitted """ - result = pretty_table( + result = prettytable( String, data; header = ( diff --git a/test/test_PT_titles.jl b/test/test_PT_titles.jl index 2bb8f805d..5b88ff52d 100644 --- a/test/test_PT_titles.jl +++ b/test/test_PT_titles.jl @@ -28,7 +28,7 @@ This is a very very long title that will be displayed above the table. │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table(String, data, title = title) + result = prettytable(String, data, title = title) @test result == expected expected = """ @@ -44,7 +44,7 @@ This is a very very long title that … │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; title = title, @@ -66,7 +66,7 @@ will be displayed above the table. │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; title = title, @@ -89,7 +89,7 @@ will be displayed above the table. │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; title = title, @@ -113,7 +113,7 @@ will be displayed above the table. │ 6 │ true │ 6.0 │ 6 │ └────────┴────────┴────────┴────────┘ """ - result = pretty_table( + result = prettytable( String, data; title = title, @@ -149,7 +149,7 @@ That has two lines. └────────┴────────┴────────┴─────── 1 column and 3 rows omitted """ - result = pretty_table( + result = prettytable( String, data; crop = :both, @@ -171,7 +171,7 @@ That has two lines. └────────┴────────┴────────┴─────── 1 column and 4 rows omitted """ - result = pretty_table( + result = prettytable( String, data; crop = :both, diff --git a/test/test_common_opts.jl b/test/test_common_opts.jl index 12c5f92d6..d513079c1 100644 --- a/test/test_common_opts.jl +++ b/test/test_common_opts.jl @@ -98,7 +98,7 @@ @test GMT.get_color((:red,:blue)) == "red,blue" @test GMT.get_color((200,300)) == "200,300" @test_throws ErrorException("\tGET_COLOR: Input as Array must be a Mx3 matrix or 3 elements Vector.") GMT.get_color([1,2]) - @test_throws ErrorException("\tGET_COLOR: got an unsupported data type: UnitRange{Int64}") GMT.get_color(1:3) + @test_throws ErrorException("\tGET_COLOR: got an unsupported data type") GMT.get_color(1:3) @test_throws ErrorException("Color tuples must have only one or three elements") GMT.get_color(((0.2,0.3),)) @test GMT.parse_unit_unit("data") == "u" @test GMT.parse_units((2,:p)) == "2p"