You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2019/11/06 11:50:18 UTC
[GitHub] [netbeans] junichi11 commented on issue #1617: [NETBEANS-3335]
Enhance robustness of HTML Lexer
junichi11 commented on issue #1617: [NETBEANS-3335] Enhance robustness of HTML Lexer
URL: https://github.com/apache/netbeans/pull/1617#issuecomment-550275723
@matthiasblaesing
Maybe, we can add unit tests to the smarty module:
```diff
diff --git a/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl
new file mode 100644
index 0000000000..c476b594d0
--- /dev/null
+++ b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl
@@ -0,0 +1 @@
+<a {if $smarty.server.REQUEST_URI|strstr:"/new"}class="underline"{/if} href="{url('new')}">
diff --git a/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl.errors b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl.errors
new file mode 100644
index 0000000000..607da0e3dc
--- /dev/null
+++ b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_01.tpl.errors
@@ -0,0 +1 @@
+Detected parser errors in the file:
diff --git a/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl
new file mode 100644
index 0000000000..f6bb7c35a4
--- /dev/null
+++ b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl
@@ -0,0 +1 @@
+<div class="{if $test eq ""}toto{/if}" {if $test}id="titi"{/if}></div>
diff --git a/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl.errors b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl.errors
new file mode 100644
index 0000000000..607da0e3dc
--- /dev/null
+++ b/php/php.smarty/test/unit/data/testfiles/parserErrors/testParserNETBEANS3335_02.tpl.errors
@@ -0,0 +1 @@
+Detected parser errors in the file:
diff --git a/php/php.smarty/test/unit/src/org/netbeans/modules/php/smarty/editor/parser/TplParserErrorsTest.java b/php/php.smarty/test/unit/src/org/netbeans/modules/php/smarty/editor/parser/TplParserErrorsTest.java
index 1ef5f93591..1caa6f3434 100644
--- a/php/php.smarty/test/unit/src/org/netbeans/modules/php/smarty/editor/parser/TplParserErrorsTest.java
+++ b/php/php.smarty/test/unit/src/org/netbeans/modules/php/smarty/editor/parser/TplParserErrorsTest.java
@@ -118,6 +118,15 @@ public class TplParserErrorsTest extends TplTestBase {
assertParserErrors();
}
+ // no errors
+ public void testParserNETBEANS3335_01() throws Exception {
+ assertParserErrors();
+ }
+
+ public void testParserNETBEANS3335_02() throws Exception {
+ assertParserErrors();
+ }
+
private String getTestFileRelPath() {
return "testfiles/parserErrors/" + getName() + ".tpl";
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists