File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
src/test/java/org/apache/ibatis/scripting/xmltags Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,14 @@ void shouldWhereInsertWhitespace() throws Exception {
3030 String xml = """
3131 <script>
3232 select * from user
33- <where>
34- <if test="1==1">and id = 1</if>
35- <if test="1==1">and id > 0</if>
36- </where>
33+ <where><if test="1==1">and id = 1</if><if test="1==1">and id > 0</if></where>
34+ <if test="1==1">and id = 1</if><if test="1==1">and id > 0</if>
3735 </script>
3836 """ ;
3937 SqlSource sqlSource = new XMLScriptBuilder (new Configuration (), new XPathParser (xml ).evalNode ("/script" ))
4038 .parseScriptNode ();
41- assertThat (sqlSource .getBoundSql (1 ).getSql ())
42- . containsPattern ( "(?m)^\\ s*select \\ * from user\\ s+WHERE\\ s+id = 1\\ s+and id > 0\\ s*$" );
39+ assertThat (sqlSource .getBoundSql (1 ).getSql ()). containsPattern (
40+ "(?m)^\\ s*select \\ * from user\\ s+WHERE\\ s+id = 1 \\ s+and id > 0 \\ s+and id = 1\\ s+and id > 0\\ s*$" );
4341 }
4442
4543}
You can’t perform that action at this time.
0 commit comments