elegaanz / toml-glib Goto Github PK
View Code? Open in Web Editor NEWTOML library for Vala and GLib
License: GNU General Public License v3.0
TOML library for Vala and GLib
License: GNU General Public License v3.0
From SkyzohKey
This link might interest you: https://github.com/BurntSushi/toml-test
It would help making the lib up-to-date with the spec by running it on a pipeline, ensuring commits doesn't break toml compat.
The meson.build
file says MIT, while the LICENSE
file says GPL-3. I guess we may want to unify the license to either one (or possibly another one like LGPL-3).
This example is directly from the toml.io page:
[dog."tater.man"]
type.name = "pug"
But trying to access them with doc["dog"]["tater.man"]["type"]["name"].as<string> ()
fails with:
[ERROR] Nothing at `dog`.
Here's a simple example for your tests which outputs the error in the log.
diff --git a/tests/toml-glib.vala b/tests/toml-glib.vala
index a5e0491..2c6b8b6 100644
--- a/tests/toml-glib.vala
+++ b/tests/toml-glib.vala
@@ -36,12 +36,16 @@ date-of-birth = 1975-05-07T08:34:45
[hello]
description = "Something really cool"
+
+[dog."tater.man"]
+type.name = "pug"
""").parse ();
var test = Toml.Serialization.deserialize<SerializationTester> (doc);
assert_true (doc["name"].as<string> () == test.name);
assert_true (doc["age"].as<int> () == test.age);
assert_true (doc["date-of-birth"].as<DateTime> () == test.date_of_birth);
assert_true (doc["hello"]["description"].as<string> () == test.hello.description);
+ assert_true (doc["dog"]["tater.man"]["type"]["name"].as<string> () == "pug");
} catch (Error err) {
print ("ERROR: %s\n", err.message);
Test.fail ();
…
# Start of toml-glib tests
ok 1 /toml-glib/parser
ok 2 /toml-glib/serialize
ERROR: Nothing at `dog`.
not ok 3 /toml-glib/deserialize
# Start of lexer tests
…
Bonus issue:
You're not using your environment variable G_TEST_SRCDIR
inside your tests so the tests /toml-glib/parser/file
and /toml-glib/parser/whole-spec
fail with
[ERROR] Failed to open file ?test.toml?: No such file or directory
not ok 12 /toml-glib/parser/file
[ERROR] Failed to open file ?all.toml?: No such file or directory
not ok 13 /toml-glib/parser/whole-spec
Bonus issue:
With the above file issue fixed I expect all.toml
to fail or throw errors because it contains invalid configurations but it doesn't.
Have a method to convert a table to an Hashmap<string, Element>
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.