Commit Graph

12 Commits

Author SHA1 Message Date
stasoid
9c2c6fffa2 fix test 2022-03-19 09:30:22 +06:00
stasoid
0d8b75f3bd remove xxd
Use pure CMake solution as described here: https://stackoverflow.com/questions/410980/include-a-text-file-in-a-c-program-as-a-char/47801116#47801116
2022-03-17 21:53:01 +06:00
John Poole
463cfc2de1
Merge branch 'master' into url-class 2021-09-25 20:26:05 -04:00
John Poole
5460deec6b
Merge pull request #3 from primatelabs/tstring_view
Add tstring_view, a string reference type
2021-09-25 20:24:38 -04:00
John Poole
8bbf9afed6 Disable test that only fails on GitHub Actions
CSSTest.SelectorParse fails on GitHub Actions but not on Travis or on
any developer systems.  Disable the test until we can determine what's
going on here.
2021-09-25 19:51:12 -04:00
John Poole
527fbe3413 Extend URL path resolution to handle relative paths
This is implemented using several URL path helper functions.  The
functions aren't strictly necessary, but the functions make it easier
to implement and test the resolution functionality.
2021-09-25 13:52:56 -04:00
John Poole
d3c368458d Add a url class
The url class is a URL parser and container class that makes working
with URLs easier.  In particular, the resolve() function makes working
with base URLs and possibly relative URLs easier.

url instances are meant to be immutable.  If users need to modify a
url instance they can do so by creating a new url instance.  See the
resolve() implementation for a non-trivial example of how to build a
new url instance using existing url instances.

Note that the current implementation is inefficient due to each URL
component requiring its own separate memory allocation.  We should
consider re-writing this to use tstring_view once that branch is
merged into master.
2021-09-25 11:58:31 -04:00
John Poole
3147b4fc78 Add codepoint utility functions, tests
Add codepoint utility functions that test whether a codepoint belongs
to a set of codepoints (e.g., the valid codepoints for a URL scheme).
Most of these functions are implemented using a compact lookup table
so should be reasonably fast.

The functions are based on similar functions from the css-parser branch
that were introduced in commit 1698324920.  We'll want to merge these
sets of functions together once the branches are merged.
2021-09-25 11:57:52 -04:00
John Poole
14e2001376 Add tstring_view, a string reference type
tstring_view is a string reference type that provides a view into a
string that is owned elsewhere (e.g., by a std::string object).

tstring_view implements the same interface as std::base_string_view in
the standard library.  When litehtml moves to C++17 consider replacing
the tstring_view implementation with the standard library
implementations (e.g., via a using statement).
2021-09-23 14:56:34 -04:00
John Poole
7501793675 Convert litehtml tests to use GoogleTest
GoogleTest provides a number of nice features (such as autodiscovery)
that make writing and running tests easier and less tedious.  This
patch converts the litehtml tests over to use GoogleTest.  Note that
the conversion is mostly mechanical -- no attempt has been made to
make the tests "idiomatic" GoogleTests.

Most of the CMake changes are based on code from the GoogleTest
documentation, specifically the "Quickstart: Building with CMake"
guide:

  https://google.github.io/googletest/quickstart-cmake.html
2021-08-25 17:51:12 -04:00
Sky Morey
04d8b410c1 added tests, optimized text parsing for <script> 2019-08-18 15:58:26 -05:00
Sky Morey
cd15b54730 Added testing 2019-08-17 20:26:08 -05:00