Commit Graph

321 Commits

Author SHA1 Message Date
ToruNiina
2c192af35d test: add test for toml::string format 2019-06-29 20:20:31 +09:00
ToruNiina
299d1098e4 test: add serialization test for arbitrary file 2019-06-29 16:40:42 +09:00
ToruNiina
0fc0967f6f fix: remove CR before comparing to the reference 2019-06-29 15:38:28 +09:00
ToruNiina
df0d870c97 test: add test for serialization with nocomment 2019-06-29 15:00:00 +09:00
ToruNiina
937a3b4a2e test: add test for nocomment/showcomment 2019-06-28 19:09:05 +09:00
ToruNiina
6182f3ee9d test: add test for operator<<(os, non-table-value) 2019-06-28 17:56:41 +09:00
ToruNiina
37e96ed8dc test: add test for format_key() 2019-06-28 17:47:42 +09:00
ToruNiina
134475e292 test: check ostream op for comment containers 2019-06-28 14:58:16 +09:00
ToruNiina
3a5f8a4b88 test: rename test source file 2019-06-22 17:23:51 +09:00
ToruNiina
4d2b24b647 test: add test_find_or 2019-06-22 16:58:45 +09:00
ToruNiina
3fcb6bb20d test: fix test module name 2019-06-22 16:58:21 +09:00
ToruNiina
1e8af710a0 test: add test for get_or 2019-06-22 16:39:01 +09:00
ToruNiina
0ca8eeeb09 test: add missing include files 2019-06-21 17:11:21 +09:00
ToruNiina
b79797d2c7 refactor: replace BOOST_CHECK_EQUAL by BOOST_TEST 2019-06-21 16:01:14 +09:00
ToruNiina
90918b6d76 test: add basic_value type to serialization tests 2019-06-21 16:01:08 +09:00
ToruNiina
dd9b04ae3b fix: fix test case name 2019-06-21 16:01:04 +09:00
ToruNiina
4032b438c0 fix: time offset may change while conversion 2019-06-21 16:00:48 +09:00
ToruNiina
7b37d876ae refactor: update Boost.Test v2 to v3 2019-06-21 14:50:17 +09:00
ToruNiina
713b42e589 refactor: use CHECK_THROW macro to check it throws 2019-06-21 14:47:27 +09:00
ToruNiina
1694f74510 chore: update boost test library usage (v2->v3) 2019-06-21 14:43:13 +09:00
ToruNiina
9f69ffa993 fix: add unsigned symbol to integer literals 2019-06-21 14:42:44 +09:00
ToruNiina
0cee58b0b1 Merge branch 'v3' of github.com:ToruNiina/toml11 into v3 2019-06-21 14:31:52 +09:00
ToruNiina
e8d535e485 test: add tests for constructors with comments 2019-06-21 14:26:49 +09:00
ToruNiina
ec839bbd75 chore: add -Wextra when compiling tests 2019-06-21 00:29:45 +09:00
ToruNiina
3b71f80652 refactor: streamsize is a signed integer 2019-06-21 00:00:37 +09:00
ToruNiina
86a1f7ad75 fix: add missing include files 2019-06-20 16:23:51 +09:00
ToruNiina
99c10dd6bc fix: enable to deduce what basic_value to be used 2019-06-20 16:21:01 +09:00
ToruNiina
c3922c0d51 test: move some test_cases across test files 2019-06-20 14:43:31 +09:00
ToruNiina
f178379c07 test: add test_find 2019-06-20 14:34:42 +09:00
ToruNiina
9663a6bbdb Merge branch 'master' into v3 2019-06-19 19:53:08 +09:00
ToruNiina
cab3144507 style: format CMakelists.txt 2019-06-19 16:53:45 +09:00
ToruNiina
7e5859ba73 Merge branch 'master' into v3 2019-06-19 15:36:27 +09:00
ToruNiina
86e55c3bf7 test: check serialization keeps comments 2019-06-18 01:26:16 +09:00
ToruNiina
159283fdad test: check preserve_comment keep it read 2019-06-18 01:25:43 +09:00
ToruNiina
fb5834caab refactor: exchange order of test section 2019-06-18 00:45:30 +09:00
ToruNiina
228487eafd test: fix typos in tests 2019-06-17 23:46:42 +09:00
ToruNiina
bf2dc76d5e test: add test for templatized conversions 2019-06-17 23:21:18 +09:00
ToruNiina
4008c24e84 test: add test for init-list-map to value conversion 2019-06-17 22:50:38 +09:00
ToruNiina
bf4eae0b76 test: drop test for find_or(table) 2019-06-17 22:14:26 +09:00
Toru Niina
569341a514
Merge pull request #69 from KerstinKeller/cmake_install
Allow to install toml11 library with CMake.
2019-06-17 18:03:00 +09:00
ToruNiina
cbaaaaca7c revert recursive find function
I found that in a user-code (I'm also one of the users of this library),
this new feature sometimes causes an error. Some of my code won't
compile because of this change. Since toml::table is convertible to
toml::value *implicitly*, if toml::find(table, key, tablename) was
called, the overload resolution becomes ambiguous with toml::find(
value, key1, key2). But dropping support for toml::find(toml::table,
key, tablename) is a breaking change. So I concluded that now is not
the right time yet.
2019-06-16 19:55:40 +09:00
ToruNiina
8665272bab test: add test for custom basic_value type 2019-06-15 20:25:19 +09:00
ToruNiina
9acc55a7ac test: add test for discard_comment 2019-06-15 17:18:25 +09:00
ToruNiina
177022b2cb test: update tests for comment 2019-06-15 17:13:25 +09:00
KerstinKeller
acbc2a73cb Allow to install tom11 library with CMake.
Add option to build tests.
2019-06-14 17:24:21 +02:00
ToruNiina
6345910c3e 🔀 Merge branch 'master' into v3 2019-06-08 20:05:05 +09:00
ToruNiina
54d46f08c3 🔀 Merge branch 'master' into v3 2019-06-08 19:40:11 +09:00
ToruNiina
57cb806e14 Merge branch 'master' into throw-from-as-something 2019-06-08 19:23:32 +09:00
ToruNiina
d6f3654185 refactor: reduce test code by using CHECK_THROW 2019-06-08 19:23:12 +09:00
ToruNiina
8befe3f1ad test: add test for throw/nothrow versions of as_* 2019-06-08 19:20:09 +09:00
ToruNiina
31debcb8aa 🔀 Merge branch 'master' into recursive-find 2019-06-07 19:02:20 +09:00
ToruNiina
897aecf5d4 test: avoid deprecated functions in the test codes 2019-06-07 13:32:02 +09:00
ToruNiina
014d882f8f feat: enable to find value by recursive search 2019-06-07 00:06:14 +09:00
ToruNiina
e781545c53 feat(WIP): diable test for comments once
because the interfaces would be changed a lot.
2019-06-06 22:34:08 +09:00
ToruNiina
53efaed179 test: update interfaces of parse_* and value 2019-06-03 22:01:16 +09:00
ToruNiina
761718b3b9 test: update retval of parse and related get/find 2019-06-03 21:44:47 +09:00
ToruNiina
cf1114b47b test: update typenames from Camel to snake 2019-06-02 22:13:36 +09:00
ToruNiina
ad3c1950f2 test: use find instead of get<T>(v.at("")) 2019-06-02 22:12:52 +09:00
ToruNiina
296ba060ef test: update typename from CamelCase to snake_case 2019-06-02 22:11:37 +09:00
ToruNiina
c313e1382c test: update test for multiple translation units 2019-06-02 22:00:56 +09:00
ToruNiina
7d34436535 test: update value_t::* names in the test code 2019-06-02 21:36:09 +09:00
ToruNiina
c0b6ca762a feat: 💥 drop from_toml support 2019-06-02 19:27:03 +09:00
ToruNiina
b13e727b90 refactor: remove unused func, combinator::pattern
because it is not human-readable (too long and redundant)
2019-05-30 18:05:47 +09:00
ToruNiina
4cbbcd8f62 Merge branch 'master' into as-something 2019-04-27 19:04:44 +09:00
Toru Niina
a2631ecacb
Merge pull request #60 from ToruNiina/string-view
support std::string_view
2019-04-27 18:33:59 +09:00
ToruNiina
4bcc5e8375 Merge branch 'master' into as-something 2019-04-27 17:42:12 +09:00
ToruNiina
aa7b9a3965 refactor: rename as_floating -> as_float
Actually, since `floating` is used for toml::types, `as_floating`
seems to be clearer. But currently `is_*` functions uses `float`,
not `floating`, so `as_float` is chosen for the consistency.
In a future release, possibly v3, those names may need to be
re-considered for clarity.
2019-04-27 16:45:25 +09:00
ToruNiina
84ac1d10f3 test: add test for toml::value::as_something 2019-04-27 16:22:50 +09:00
ToruNiina
f3bdf083fe fix: fix typo in test code for string_view 2019-04-26 16:51:23 +09:00
ToruNiina
819351f5a4 test: add test for init toml::value by string_view 2019-04-26 16:32:23 +09:00
ToruNiina
2967cebfb3 test: add test to get a toml::value as string_view 2019-04-26 16:31:59 +09:00
ToruNiina
32e9a2c1c7 test: add test for comments in an array 2019-04-26 15:35:41 +09:00
ToruNiina
8e0a40a1aa test: add test for getting comments 2019-04-25 22:34:12 +09:00
ToruNiina
0a3a41a708 test: add test for literals for difficult case 2019-04-14 20:06:11 +09:00
ToruNiina
5aebd6b562 fix: restore the back compat of format_error
the following code was okay in the last release
```
toml::format_error("[test]", v, "test", {"hint1", "hint2"})
```
but was not okay in the current master. This commit fixes this.

cons: By this, the number of values to show is limited upto 3.
2019-03-20 20:46:22 +09:00
ToruNiina
b51a8d5966 fix: add missing include file in test code 2019-03-20 00:58:58 +09:00
ToruNiina
39bc3c64fe test: add test for ""_toml literals 2019-03-20 00:36:46 +09:00
ToruNiina
7a0ecf977d feat: add find_or(table, key, fallback)
get_or(value, fallback) is still ok, but get_or(table, key, fallback)
is now deprecated.
2019-03-18 17:44:03 +09:00
ToruNiina
ca3f6102ef fix: correctly resolve overloads of get_or 2019-03-18 16:44:36 +09:00
Toru Niina
ccf03d9291
Merge pull request #44 from ToruNiina/test-link
test: add test for multiple translation unit
2019-03-18 15:20:04 +09:00
ToruNiina
d5369c3429 test: add test for multiple translation unit 2019-03-18 12:39:58 +09:00
ToruNiina
3bfa7f09ba test: use the test suite in the effective way
add tests/check_toml_test.cpp to compare json object
2019-03-18 01:36:43 +09:00
ToruNiina
77ab391885 ci: fix name of directory and add test script 2019-03-17 19:20:24 +09:00
Toru Niina
f3e3000d45
Merge pull request #40 from ToruNiina/remove-to-toml
refactor: remove to_toml and related tests
2019-03-17 13:12:30 +09:00
Toru Niina
d86870e038
Merge pull request #38 from ToruNiina/get-any-type
extended conversions
2019-03-17 13:11:59 +09:00
ToruNiina
d17c192681 refactor: remove to_toml and related tests 2019-03-16 17:05:58 +09:00
ToruNiina
30a41aa710 fix: use older style in BOOST_TEST 2019-03-16 16:15:01 +09:00
ToruNiina
190636b791 fix: support getting a container of external types 2019-03-16 15:52:22 +09:00
ToruNiina
31e450f9af test: add test for from/into based conversions 2019-03-16 15:46:21 +09:00
ToruNiina
055353a460 chore: merge branch 'master' into is-something 2019-03-15 17:25:17 +09:00
ToruNiina
59aaaab436 test: add test to check format_error compiles 2019-03-15 12:40:01 +09:00
ToruNiina
6693ec78f4 test: add test for toml::value::is_something() 2019-03-12 20:44:27 +09:00
ToruNiina
679b365cf7 feat: get region info when parsing keys
Error messages related to dotted keys looks weird. like:
 1 | a.b.c = 42
   |         ~~ in this table
The underlined token is not a table. This should be like the following.
 1 | a.b.c = 42
   | ~~~ in this table
To implement this, the region information is needed when the keys are
read. This commit add this functionality, though currently the region
information is not used yet.
2019-02-26 00:17:28 +09:00
ToruNiina
24aefc52a1 test: set width in test_serialize 2019-02-14 15:46:12 +09:00
ToruNiina
ba8c205253 fix: change CRLF into LF before comparison 2019-02-13 23:48:53 +09:00
ToruNiina
31193d99ba Merge branch 'master' into serialize 2019-02-13 23:16:39 +09:00
ToruNiina
46569da231 fix: avoid auto-conversion while making test case 2019-02-13 19:51:54 +09:00
ToruNiina
5e20a8ff16 fix: add scope to the test case to flush 2019-02-13 19:26:52 +09:00
ToruNiina
dd9319245e fix: open file as binary-mode #16
to avoid inconsistency between file size (obtained by tellg) and the
size of the actual contents that would be read later
2019-02-13 19:18:09 +09:00
ToruNiina
4bbe42d105 test: add test_serialize_file 2019-02-13 13:51:36 +09:00
Toru Niina
b5b8830c29
Merge pull request #17 from ToruNiina/hotfix
fix the error with BOM and end of file w/o newline
2018-12-24 16:37:10 +09:00
ToruNiina
87a5c844c2 add test cases for the end-of-file problems 2018-12-24 16:02:32 +09:00
ToruNiina
5546b3389d Merge branch 'master' into error-message 2018-12-22 17:55:59 +09:00
ToruNiina
edb48b2872 add test_error_detection to check it detects error 2018-12-22 17:43:42 +09:00
ToruNiina
4d02f399a2 add temporary to receive rvalue 2018-12-17 23:03:53 +09:00
ToruNiina
7b3684b54e add and_other and or_other to toml::result
effectively same as Rust's std::Result::and and or.
2018-12-17 18:24:41 +09:00
ToruNiina
19524dbc4b fix silly typo 2018-12-16 21:13:21 +09:00
ToruNiina
c2e733a65d enable to get toml::value as toml::value 2018-12-16 20:50:40 +09:00
ToruNiina
95d73a290f add test case for reading dotted-keys 2018-12-13 13:07:48 +09:00
ToruNiina
26e0d87d3b enable nanoseconds in datetimes 2018-12-13 12:49:53 +09:00
ToruNiina
fb6d51954a turn test_parse_unicode on; no change required 2018-12-13 02:28:52 +09:00
ToruNiina
4d7cfc9d1d turn test_parse_file on
the required change is;
- change Datetime -> offset_datetime and construct correctly.
2018-12-13 02:26:55 +09:00
ToruNiina
514f3c773f set test_from_toml 2018-12-13 02:24:03 +09:00
ToruNiina
27a80b1214 rename get(table, key) to find() 2018-12-13 02:00:13 +09:00
ToruNiina
f62bcb3077 update cmakelists 2018-12-13 01:30:25 +09:00
ToruNiina
be1a310ae5 move test for find to get_related 2018-12-13 01:30:06 +09:00
ToruNiina
2080b30110 add test cases for test_to_toml 2018-12-13 00:38:36 +09:00
ToruNiina
d370ae7d0d set tm_isdst as negative value 2018-12-13 00:35:43 +09:00
ToruNiina
83b588a8c8 rename test code 2018-12-13 00:35:05 +09:00
ToruNiina
a19c9b4a39 add test case for find & get 2018-12-12 21:55:11 +09:00
ToruNiina
f64430af92 remove old test; individual test cases are added
test_parse_* is now available, old test_parser is not needed now
2018-12-12 20:55:58 +09:00
ToruNiina
8e154cdd74 add test case for parsing datetime 2018-12-12 20:55:30 +09:00
ToruNiina
cfd82c95f0 add test case for getting converted map 2018-12-12 20:32:26 +09:00
ToruNiina
18a22eb3c4 add test cases for datetime variants 2018-12-12 20:28:31 +09:00
ToruNiina
5a20d55dd0 add test for toml::get 2018-12-12 17:23:06 +09:00
ToruNiina
fcbfbd3a26 supress warning about comparison between signed and unsigned 2018-12-12 16:12:10 +09:00
ToruNiina
5dea88001e add test case for array-of-tables 2018-12-12 12:13:49 +09:00
ToruNiina
b63dc1f370 remove extra comma 2018-12-12 01:36:20 +09:00
ToruNiina
d3e88b3082 add test case for table key 2018-12-12 01:31:36 +09:00
ToruNiina
9f8e86524a add a lot of dotted keys to test_lex 2018-12-12 01:26:56 +09:00
ToruNiina
4d64c0d8af add tests for inline table 2018-12-11 23:38:57 +09:00
ToruNiina
e810c3d35e add tests for equivalent operator 2018-12-11 23:33:32 +09:00
ToruNiina
fc3471434f add test for array 2018-12-11 23:31:24 +09:00
ToruNiina
be8600abfa add test for key and string 2018-12-11 23:25:44 +09:00
ToruNiina
e79e6150f2 update testing macro 2018-12-11 23:25:23 +09:00
ToruNiina
3055645323 remove old tests 2018-12-11 21:52:53 +09:00
ToruNiina
0253f49101 add a test for parser (WIP) 2018-12-11 21:51:39 +09:00
ToruNiina
e24039f4ef update toml::value and improve test_value
- enable to store new types
- store source string if possible
- refactoring
2018-12-09 18:03:20 +09:00
ToruNiina
8388664fc6 add map_err_or_else to result 2018-12-08 22:44:15 +09:00
ToruNiina
2b2a05148e add from_string to utility 2018-12-08 20:21:15 +09:00
ToruNiina
861444a02b disable some of the tests once 2018-12-08 19:23:53 +09:00
ToruNiina
1e28cb2d13 add test for concat_string 2018-12-08 19:22:41 +09:00
ToruNiina
ae564bd814 change include file of test_traits 2018-12-08 19:22:31 +09:00
ToruNiina
366f72bbdd Merge branch 'datetime' into combinator 2018-12-08 19:06:19 +09:00
ToruNiina
3ef33c1637 change almost everything about datetime 2018-12-08 19:04:41 +09:00
ToruNiina
f8aa604959 Merge branch 'result' into combinator
- fix some of the constructors of result
- add some utility member functions to boost
2018-12-06 12:57:58 +09:00
ToruNiina
e3f6805629 add conversion members to result 2018-12-06 12:47:14 +09:00
ToruNiina
f9a018b5ea add source_name to test_lex_aux macros 2018-12-05 17:19:37 +09:00
ToruNiina
c3a2cd8c1e use hexcode instead of u8 string on windows 2018-12-04 21:43:43 +09:00
ToruNiina
c0ce5a2d7d remove debug message from test code 2018-12-04 21:00:34 +09:00