Good catch, I've committed your patch.

Thanks Marc!

--j

On Fri, Jan 9, 2009 at 2:55 PM, Marc Boschma
<[email protected]<marc%[email protected]>
> wrote:

> I've just noticed that the test in AppTest.scala for XML and XHTML etc
> doesn't take into account Html entities...
>
> >
>
>
>
>
> So I suggest the following change (as a diff -c) and attached the full
> file...
>
> ------------------------------------------------------
> *** AppTest.scala.orig  2009-01-10 09:19:45.000000000 +1100
> --- AppTest.scala       2009-01-10 09:49:47.000000000 +1100
> ***************
> *** 4,9 ****
> --- 4,10 ----
>   import _root_.junit.framework._
>   import Assert._
>   import _root_.scala.xml.XML
> + import _root_.net.liftweb.util._
>
>   object AppTest {
>     def suite: Test = {
> ***************
> *** 36,56 ****
>     def testXml() = {
>       var failed: List[File] = Nil
>
> !     def handled(file: String) =
> !       file.endsWith(".html") || file.endsWith(".xml") ||
> !       file.endsWith(".htm")  || file.endsWith(".xhtml")
>
>       def wellFormed(file: File) {
>         if (file.isDirectory)
>           for (f <- file.listFiles) wellFormed(f)
>
> !       if (file.isFile && handled(file.getName)) {
>           try {
>             XML.loadFile(file)
>           } catch {
>             case e: _root_.org.xml.sax.SAXParseException => failed =
> file :: failed
>           }
>         }
>       }
>
>       wellFormed(new File("src/main/webapp"))
> --- 37,65 ----
>     def testXml() = {
>       var failed: List[File] = Nil
>
> !     def handledXml(file: String) =
> !       file.endsWith(".xml")
> !
> !     def handledXHtml(file: String) =
> !       file.endsWith(".html") || file.endsWith(".htm") ||
> file.endsWith(".xhtml")
>
>       def wellFormed(file: File) {
>         if (file.isDirectory)
>           for (f <- file.listFiles) wellFormed(f)
>
> !       if (file.isFile && handledXml(file.getName)) {
>           try {
>             XML.loadFile(file)
>           } catch {
>             case e: _root_.org.xml.sax.SAXParseException => failed =
> file :: failed
>           }
>         }
> +       if (file.isFile && handledXHtml(file.getName)) {
> +       PCDataXmlParser(new java.io.FileInputStream(file.getAbsolutePath))
> match {
> +         case Full(_) => // file is ok
> +         case _ => failed = file :: failed
> +       }
> +       }
>       }
>
>       wellFormed(new File("src/main/webapp"))
>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to