@ParameterizedRobolectricTestRunner.Parameters
  public static Collection<Object[]> data() {
    return Arrays.asList(
        new Object[][] {
          // -------------------------- Small drawable left/right margin --------------------------
          {
            "Center - small drawable - margin left",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Center - small drawable - margin right",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Center - small drawable - margin left and right",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin left",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin right",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin left and right",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin left",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin right",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin left and right",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          // -------------------------- Large drawable left/right margin --------------------------
          {
            "Center - large drawable - margin left",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -30, // expectedAscent
            20, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -30, // expectedTop
            20 // expectedBottom
          },
          {
            "Center - large drawable - margin right",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -30, // expectedAscent
            20, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -30, // expectedTop
            20 // expectedBottom
          },
          {
            "Center - large drawable - margin left and right",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -30, // expectedAscent
            20, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -30, // expectedTop
            20 // expectedBottom
          },
          {
            "Baseline - large drawable - margin left",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - large drawable - margin right",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - large drawable - margin left and right",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin left",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                10, // margin left
                0, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -40, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -40, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin right",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                0, // margin top
                10, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -40, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -40, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin left and right",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                5, // margin left
                0, // margin top
                5, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -40, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -40, // expectedTop
            15 // expectedBottom
          },
          // -------------------------- Small drawable top/bottom margin --------------------------
          {
            "Center - small drawable - margin top",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Center - small drawable - margin bottom",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Center - small drawable - margin top and bottom",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin top",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin bottom",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - small drawable - margin top and bottom",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin top",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin bottom",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - small drawable - margin top and bottom",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            10, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -20, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -25, // expectedTop
            15 // expectedBottom
          },
          // -------------------------- Large drawable top/bottom margin --------------------------
          {
            "Center - large drawable - margin top",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -35, // expectedAscent
            25, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -35, // expectedTop
            25, // expectedBottom
          },
          {
            "Center - large drawable - margin bottom",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -35, // expectedAscent
            25, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -35, // expectedTop
            25, // expectedBottom
          },
          {
            "Center - large drawable - margin top and bottom",
            BetterImageSpan.ALIGN_CENTER,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -35, // expectedAscent
            25, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -35, // expectedTop
            25, // expectedBottom
          },
          {
            "Baseline - large drawable - margin top",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -60, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -60, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - large drawable - margin bottom",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -60, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -60, // expectedTop
            15 // expectedBottom
          },
          {
            "Baseline - large drawable - margin top and bottom",
            BetterImageSpan.ALIGN_BASELINE,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -60, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -60, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin top",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                10, // margin top
                0, // margin right
                0 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin bottom",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                0, // margin top
                0, // margin right
                10 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          },
          {
            "Bottom - large drawable - margin top and bottom",
            BetterImageSpan.ALIGN_BOTTOM,
            new Rect(
                0, // margin left
                5, // margin top
                0, // margin right
                5 // margin bottom
                ),
            50, // drawableHeight
            -20, // fontAscent
            10, // fontDescent
            -50, // expectedAscent
            10, // expectedDescent
            -25, // fontTop
            15, // fontBottom
            -50, // expectedTop
            15 // expectedBottom
          }
        });
  }
Tests the dimensions assigned by {@link BetterImageSpan} ensuring the width/height of is
calculated correctly for different combinations of image and text height, as well as span
alignment and image margin.
fbcore/src/test/java/com/facebook/widget/text/span/BetterImageSpanMarginTest.java