File tree 1 file changed +4
-6
lines changed
src/test/java/org/apache/ibatis/scripting/xmltags
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 {
30
30
String xml = """
31
31
<script>
32
32
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>
37
35
</script>
38
36
""" ;
39
37
SqlSource sqlSource = new XMLScriptBuilder (new Configuration (), new XPathParser (xml ).evalNode ("/script" ))
40
38
.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*$" );
43
41
}
44
42
45
43
}
You can’t perform that action at this time.
0 commit comments