"""
Tests for coast
"""
import pytest
from pygmt import Figure
from pygmt.helpers.testing import check_figures_equal


@pytest.mark.mpl_image_compare
def test_coast():
    "Simple plot from the GMT docs"
    fig = Figure()
    fig.coast(
        R="-30/30/-40/40",
        J="m0.1i",
        B=5,
        I="1/1p,blue",
        N="1/0.25p,-",
        W="0.25p,white",
        G="green",
        S="blue",
        D="c",
        A=10000,
    )
    return fig


@check_figures_equal()
def test_coast_iceland():
    "Test passing in R as a list"
    fig_ref, fig_test = Figure(), Figure()
    # Use single-character arguments for the reference image
    fig_ref.coast(R="-30/-10/60/65", J="m1c", B="", G="p28+r100")
    fig_test.coast(
        region=[-30, -10, 60, 65], projection="m1c", frame=True, land="p28+r100"
    )
    return fig_ref, fig_test


@pytest.mark.mpl_image_compare
def test_coast_aliases():
    "Test that all aliases work"
    fig = Figure()
    fig.coast(
        region="-30/30/-40/40",
        projection="m0.1i",
        frame="afg",
        rivers="1/1p,black",
        borders="1/0.5p,-",
        shorelines="0.25p,white",
        land="moccasin",
        water="skyblue",
        resolution="i",
        area_thresh=1000,
    )
    return fig


@pytest.mark.mpl_image_compare
def test_coast_world_mercator():
    "Test passing generating a global Mercator map with coastlines"
    fig = Figure()
    fig.coast(
        region=[-180, 180, -80, 80],
        projection="M10i",
        frame="af",
        land="#aaaaaa",
        resolution="l",
        water="white",
    )
    return fig

@@ -849,37 +849,29 @@
 %0A%0A%0A@
-pytest.mark.mpl_image_compare
+check_figures_equal()
 %0Adef
@@ -933,35 +933,412 @@
 %0A    fig
- = Figure()%0A    fig
+_ref, fig_test = Figure(), Figure()%0A    fig_ref.coast(%0A        R=%22-30/30/-40/40%22,%0A        J=%22M25c%22,%0A        B=%22afg%22,%0A        I=%221/1p,black%22,%0A        N=%221/0.5p,-%22,%0A        W=%220.25p,white%22,%0A        G=%22moccasin%22,%0A        S=%22skyblue%22,%0A        D=%22i%22,%0A        A=1000,%0A        L=%22jCM+c1+w1000k+f+l%22,%0A        U=True,%0A        X=%22a4c%22,%0A        Y=%22a10c%22,%0A        p=%22135/25%22,%0A        t=13,%0A    )%0A    fig_test
 .coast(%0A
@@ -1352,32 +1352,40 @@
  region=
-%22-30/30/-40/40%22,
+%5B-30, 30, -40, 40%5D,  # R
 %0A       
@@ -1397,23 +1397,27 @@
 ection=%22
-m0.1i%22,
+M25c%22,  # J
 %0A       
@@ -1425,24 +1425,29 @@
 frame=%22afg%22,
+  # B
 %0A        riv
@@ -1455,32 +1455,37 @@
 rs=%221/1p,black%22,
+  # I
 %0A        borders
@@ -1488,32 +1488,37 @@
 ders=%221/0.5p,-%22,
+  # N
 %0A        shoreli
@@ -1527,32 +1527,37 @@
 s=%220.25p,white%22,
+  # W
 %0A        land=%22m
@@ -1557,32 +1557,37 @@
 land=%22moccasin%22,
+  # G
 %0A        water=%22
@@ -1587,32 +1587,37 @@
 water=%22skyblue%22,
+  # S
 %0A        resolut
@@ -1620,24 +1620,29 @@
 olution=%22i%22,
+  # D
 %0A        are
@@ -1651,24 +1651,223 @@
 thresh=1000,
+  # A%0A        map_scale=%22jCM+c1+w1000k+f+l%22,  # L%0A        timestamp=True,  # U%0A        xshift=%22a4c%22,  # X%0A        yshift=%22a10c%22,  # Y%0A        perspective=%5B135, 25%5D,  # p%0A        transparency=13,  # t
 %0A    )%0A    r
@@ -1871,24 +1871,38 @@
   return fig
+_ref, fig_test
 %0A%0A%0A@pytest.m

Update test_coast_aliases (#769)