| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
Conflicts:
json-glib/tests/path.c
|
|
|
|
| |
And use g_test_build_filename().
|
|
|
|
|
|
|
| |
Instead of our homegrown solution. This should fix the regression in the
installed tests case.
Original patch by: Colin Walters <walters@verbum.org>
|
|
|
|
|
| |
We depend on a new version of GLib, so we can remove a bunch of old
version checks.
|
|
|
|
|
| |
Instead of using the old GLib test harness, we should use the newly
added TAP support and the TAP driver inside autotools.
|
|
|
|
|
|
|
| |
See https://live.gnome.org/GnomeGoals/InstalledTests for more
information.
It's still possible to run `make check` with locally uninstalled tests.
|
|
|
|
|
| |
Run each expression as a separate unit, so we can catch errors more
quickly and easily.
|
| |
|
|
|
|
|
|
|
| |
This will allow adding negative tests to JsonPath.
The tests will only be caught when compiling the query; an invalid query
won't return a match, so there's no point to check matches.
|
|
|
|
|
| |
Similar to the fix that went in commit path e348b1fa, we need to fix
getting all the members of an object by using the wildcard notation.
|
|
|
|
|
|
|
|
|
| |
Using the same data as in tests, asking for $['store']['book'][*] JSON path
should return all the book objects in an array.
But that array is returned inside another array, dupped several times.
https://bugzilla.gnome.org/show_bug.cgi?id=691557
|
|
|
|
|
|
|
|
| |
Starting from GLib 2.36, g_type_init() is going to be deprecated (the
type system will be initialized as soon as libgobject is paged in, using
constructors). As I don't want to bump dependencies just for that, the
call to g_type_init() should be placed under a compile-time version
check, to keep the noise from compiler warnings down.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This is the positive equivalent of the test case inside the invalid test
unit.
|
| |
|
| |
|
| |
|
|
|
|
| |
Instead of putting it inside the parser unit test.
|
|
|
|
|
|
|
|
| |
When retrieving an int, a double, or a boolean, we can use the C rules
of implicit conversion to move from the actual stored type inside the
JsonValue to the requested C type.
https://bugzilla.gnome.org/show_bug.cgi?id=660795
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
While we have to give up deserializing CONSTRUCT_ONLY properties with
JsonSerializable, CONSTRUCT properties should just be deserialized like
any other property.
Sadly, there's still a refuse in the json_gobject_new() code that skips
CONSTRUCT properties along with CONSTRUCT_ONLY ones — a remnant of a
period when we deserialized them both without JsonSerializable.
https://bugzilla.gnome.org/show_bug.cgi?id=655526
|
|
|
|
|
| |
Use a structure to keep the testable expressions and their results
together.
|
|
|
|
|
|
| |
This avoids some linking failures.
Closes: bgo#653295 - json-glib tests need to link against libgobject-2
|
|
|
|
| |
It's pointless to add the '-test' suffix to files under the tests/ directory.
|
|
|
|
|
| |
Do not test the defaults: create the GObject instance with different
values than the default ones from the GParamSpec.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JSONPath is a JSON query syntax similar to what XPath does for XML;
using JSONPath it's possible to address a specific node (or set of
nodes) inside a JSON document.
The JsonPath class is a simple implementation of part of the JSONPath
proposal, as formalised by Stefan Gössner here:
http://goessner.net/articles/JsonPath/
The covered operators are:
• root, or '$';
• child, both using the dot-notation and the bracket notation;
• recursive descent, or '..';
• subscript, or '[]';
• set, or '[,]';
• slice, or '[start:end:step]'.
The only missing operators are the filter, or '?()' and the script,
or '()', because implementing a JavaScript interpreter inside JSON-GLib
is not one of my greatest aspirations. It should be possible, though,
to parse and evaluate simple arithmetic conditions, in the future.
The JsonPath methods are pretty straightforward: a JsonPath instance
should be created and used to compile an expression; the compilation
might result in a syntax error or not. Then, the JsonPath instance can
be used to match any JSON tree. Like the other JSONPath implementations,
JsonPath returns a JSON array of matching nodes.
A simple, one-off static method called json_path_query() is also
provided; the method wraps the JsonPath creation, the expression
compilation, and the matching, as well as disposing the JsonPath
instance once done.
For the time being, only positive testing is provided; negative testing
for the expression compilation will follow.
|
|
|
|
|
| |
Clean up some odd code, and add a unit for the empty object case outlined
in bug 651271.
|
|
|
|
|
| |
The test framework should live under the json-glib directory, and not be
spread across the project.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=640729
|
|
|
|
|
| |
Verify that setting an object member multiple times does not lead to
random values.
|
|
|
|
| |
This should allow easy access to the member name during iteration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If we assume that a JSON object is just an array with a named mapping
then the JsonReader API should be able to descend into objects using the
same API used for arrays.
This obviously is less useful than it sounds if we take a very strict
interpretation of JSON objects as unordered string-to-value mappings; as
the ordering is not guaranteed to be stable, parsers would be fairly
weak against various JSON definitions.
If the JSON format parsed is guaranteed to be stable then an integer
offset might be an easy (albeit slightly less performant) way to access
data.
|
|
|
|
|
| |
Allow retrieving a list of member names from the current cursor position
of the JsonReader. It's useful if you're trying to inspect a JSON tree.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=632940
|
|
|
|
|
| |
Serialization of floating point values might lead to odd formats,
especially when dealing with IEEE machine-neutral values.
|
|
|
|
|
|
| |
There shouldn't be a requirement for this, since we're using the GLib
function explicitely for this reason, but it's always good to have a
comprehensive test suite.
|
|
|
|
|
| |
Use noinst_PROGRAMS to generate the list of test binaries to ignore
directly in the test directories.
|
|
|
|
|
| |
A JsonReader is useless without a root JsonNode to start walking the
tree from.
|
|
|
|
|
|
|
| |
Since JsonParser has far more methods for parsing a JSON stream we
should just make JsonReader an API for reading an already parsed JSON
tree - in the same way that JsonBuilder does not generate the
stringified version of the JSON tree it builds.
|
|
|
|
| |
We should strive to make JsonBuilder and JsonReader similar in API.
|
|
|
|
|
|
| |
JsonReader is a simple, cursor-based API for parsing a JSON DOM. It is
similar, in spirit, to the XmlReader API provided by various platforms
and XML parsing libraries.
|
|
|
|
|
|
| |
Tests fail to link otherwise.
Bug #626669
|
|
|
|
|
|
| |
Since we load up a test file from a directory, we should be using a
path - otherwise this will break out-of-tree builds, e.g. when doing
a distcheck.
|
| |
|
|
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=621141
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
|