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
ToruNiina
c3e1f68ef6
add u8 to the front of UTF-8 string literal
...
explicitly set the character encoding for them, for compatibility
2018-12-04 20:59:44 +09:00
ToruNiina
1a2fa6d53a
add test for lexers
2018-12-04 20:30:21 +09:00
ToruNiina
4791088106
Merge branch 'result' into combinator
2018-12-02 18:30:39 +09:00
ToruNiina
b53d11ce79
ci: downgrade test modules, use BOOST_CHECK
...
Because travis.CI installs old, out-of-date version of Boost,
BOOST_TEST is not supported. we need to use BOOST_CHECK to link
with it.
2018-12-02 18:25:09 +09:00
ToruNiina
00c3c2f773
Merge branch 'result' into combinator
2018-12-02 18:15:58 +09:00
ToruNiina
6c0a12148b
add result<T, E> struct to handle errors
...
aiming later updates and refactoring of parsers
2018-12-02 18:01:37 +09:00
ToruNiina
a32ccd82f3
fix UB in test_value (use after move)
2018-10-22 19:00:16 +09:00
ToruNiina
433636a06f
simplify the implementation of from_toml
2018-05-05 11:59:34 +09:00
ToruNiina
b6f53cae7a
update test_traits
...
now is_container returns false when map-like class is passed
2018-05-05 11:40:13 +09:00
ToruNiina
7be9548a6f
fix test_module name
2017-12-11 14:30:25 +09:00
ToruNiina
3083f65493
add get_or
2017-12-11 12:04:57 +09:00
Guillaume Fraux
57cc7f77c1
Allow to build with intel c++ compiler
2017-06-13 16:05:55 +02:00
ToruNiina
0d9b910d5d
remove test already done in other file from one file
2017-06-07 12:35:38 +09:00
ToruNiina
a198a5f103
add test for stream input
2017-05-19 14:16:12 +09:00
ToruNiina
58bb39dd39
exchange string literal to codepoints
2017-05-17 14:59:11 +09:00
ToruNiina
6df956e1d4
exchange string literal to codepoints
2017-05-17 14:57:49 +09:00
ToruNiina
ff00f45922
change literal string to sequence of codepoint
2017-05-17 14:50:29 +09:00
ToruNiina
03269588a5
wrap u8 string with std::string
2017-05-17 14:17:03 +09:00
ToruNiina
2c92142d5c
restore parser and test
2017-05-17 14:07:34 +09:00
ToruNiina
b67fcf79bc
temporally removed the test for unicode. it fails only on win
2017-05-17 13:19:08 +09:00
ToruNiina
1265952b97
split parsing unicode file
2017-05-17 12:54:13 +09:00
ToruNiina
9e9a5a7253
fix typo
2017-05-17 10:55:22 +09:00
ToruNiina
5e6d699452
add test for hard_example_unicode
2017-05-17 10:16:54 +09:00
ToruNiina
fc4fa8e3eb
exchange example of control char null to something else
2017-05-17 08:24:47 +09:00