|
Lift Framework example source code file (PCDataXmlParserSpec.scala)
The Lift Framework PCDataXmlParserSpec.scala source code/* * Copyright 2010-2011 WorldWide Conferencing, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package net.liftweb package util import org.specs.Specification /** * Systems under specification for PCDataXmlParser. */ object PCDataXmlParserSpec extends Specification("PCDataXmlParser Specification") { val data1 = """ <html>dude """ val data2 = """ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html>dude """ val data3 = """<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Meow <meta name="generator" content="Bluefish 1.0.7"/> <meta name="author" content="David Pollak"/> <meta name="date" content="2010-10-31T05:40:15-0700"/> <meta name="copyright" content=""/> <meta name="keywords" content=""/> <meta name="description" content=""/> <meta name="ROBOTS" content="NOINDEX, NOFOLLOW"/> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/> <meta http-equiv="content-style-type" content="text/css"/> </head> <body> </body> </html>""" "PCDataMarkupParser" should { "Parse a document with whitespace" in { PCDataXmlParser(data1).open_! must ==/ (<html>dude) } "Parse a document with doctype" in { PCDataXmlParser(data2).open_! must ==/ (<html>dude) } "Parse a document with xml and doctype" in { PCDataXmlParser(data3).open_!.apply(0).label must_== "html" } } } Other Lift Framework examples (source code examples)Here is a short list of links related to this Lift Framework PCDataXmlParserSpec.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.