def test_solidity_block_with_directives(self):
        expected_cases = [formatCase(case) for case in [
            """
                // SPDX-License-Identifier: GPL-3.0
                pragma solidity >=0.7.0 <0.9.0;

                contract C {
                    function foo() public view {}
                }

            """,
            """
                contract C {}
            """,
            """
                contract D {}
                :linenos:
            """,
            """
                contract E {}
            """,
        ]]

        self.assertEqual(extract_solidity_docs_cases(CODE_BLOCK_WITH_DIRECTIVES_RST_PATH), expected_cases)