Skip to content

Commit

Permalink
fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
ba0f3 committed Jun 13, 2021
1 parent 73dcafe commit 3ed5ad1
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 3 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Build"

on:
push:
pull_request:

jobs:
test:
strategy:
matrix:
os:
- windows-latest
# - macos-latest
- ubuntu-latest
nimversion:
- stable
- devel
name: ${{ matrix.os }} - ${{ matrix.nimversion }}
runs-on: ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: iffy/[email protected]
with:
version: ${{ matrix.nimversion }}
- run: nim --version
- name: Refresh packages + install dependencies
run: |
nimble refresh
nimble install -d
- name: Run all tests
run: nimble test
3 changes: 1 addition & 2 deletions src/xml.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import strformat, strutils, strtabs
const NameIdentChars = IdentChars + {':', '-', '.'}

type
XmlParserException* = object of Exception
XmlParserException* = object of CatchableError

TokenKind* = enum
TAG_BEGIN
Expand Down Expand Up @@ -74,7 +74,6 @@ iterator tokens*(input: string): XmlToken {.inline.} =
skip_until('>')
# print out prologue
#echo input[0..pos]
inc(pos)
of '!':
inc(pos)
if input[pos..pos+6] == "[CDATA[":
Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions tests/test_issue3.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import xml, xml/selector

let content1 = """<?xml version="1.0" encoding="UTF-8"?><profile>
<steamID64>76561198859045421</steamID64>
</profile>"""

let content2 = """<?xml version="1.0" encoding="UTF-8"?> <profile>
<steamID64>76561198859045421</steamID64>
</profile>"""

var
d1 = q(content1)
d2 = q(content2)

echo d1.select("steamID64")
echo d2.select("steamID64")
assert d1.select("steamID64")[0].text == d2.select("steamID64")[0].text
2 changes: 1 addition & 1 deletion xml.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.1.3"
version = "0.1.4"
author = "Huy Doan"
description = "Pure Nim XML parser"
license = "MIT"
Expand Down

0 comments on commit 3ed5ad1

Please sign in to comment.