def test_whitespace_in_running(assert_pixels):
    assert_pixels('''
        RRRRRRRR______
        RRRRRRRR______
        ______BB______
        ______BB______
    ''', '''
        <style>
            @page {
              size: 14px 4px;
              margin: 0 0 2px;
              @bottom-center {
                content: element(test);
              }
            }
            body {
              color: red;
              font-family: weasyprint;
              font-size: 2px;
              line-height: 1;
            }
            div {
              background: green;
              color: blue;
              position: running(test);
            }
        </style>
        <span>aa</span><div> a </div><span>aa</span>
    ''')
,
tests/draw/test_whitespace.py