forked from oubiwann/lxml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new tests and fixes for fast_xml support.
- Loading branch information
Showing
6 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0"?> | ||
<customers> | ||
<customer id="55000"> | ||
<name>Charter Group</name> | ||
<address> | ||
<street>100 Main</street> | ||
<city>Framingham</city> | ||
<state>MA</state> | ||
<zip>01701</zip> | ||
</address> | ||
<address> | ||
<street>720 Prospect</street> | ||
<city>Framingham</city> | ||
<state>MA</state> | ||
<zip>01701</zip> | ||
</address> | ||
<address> | ||
<street>120 Ridge</street> | ||
<state>MA</state> | ||
<zip>01760</zip> | ||
</address> | ||
</customer> | ||
</customers> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(defmodule unit-lxml-fast-tests | ||
(behaviour ltest-unit) | ||
(export all)) | ||
|
||
(include-lib "ltest/include/ltest-macros.lfe") | ||
|
||
;;; Test data | ||
|
||
(defun sample-xml-01 () | ||
(let ((file (filename:join (list (code:priv_dir 'lxml) "xml" "sample01.xml")))) | ||
(lxml:parse `#m(file ,file fxml true atom-keys? true)))) | ||
|
||
;;; Tests | ||
|
||
(deftest get-in-tag-attr-content-tuple | ||
(let ((data (sample-xml-01))) | ||
(is-equal #(archaum #m() ()) | ||
(lxml:get-in '(life archaea) data)) | ||
(is-equal #"spirochetes" | ||
(lxml:get-in '(life bacteria 1) data)) | ||
(is-equal #"cyanobacteria" | ||
(lxml:get-in '(life bacteria 3) data)))) |