Commit graph

673 commits

Author SHA1 Message Date
9650f46e23 Version strings: 0.2.0 -> 0.3.0 2017-05-03 10:48:26 +02:00
2c8bc035ee Rename test 2017-05-02 17:43:28 +02:00
5b93f3848c Merge pull request #911 from matthiasbeyer/libimagstore/storeid-exists-interface-result
Redefine return type of StoreId::exists()
2017-04-22 11:20:50 +02:00
9396accc28 Merge pull request #916 from matthiasbeyer/superceed-898
Simplify FoldResult implementation
2017-04-22 11:19:56 +02:00
111943e0eb Fix StoreId::exists() call with try!() 2017-04-21 21:08:45 +02:00
d3af023166 Redefine return type of StoreId::exists() 2017-04-21 21:08:45 +02:00
Matthew Piziak
9fa115500d Simplify FoldResult implementation
- Add tests for FoldResult
- Make documentation more explicit
- Assert failure accumulator in test

Submitted-by: Matthew Piziak <matthew.piziak@gmail.com>
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2017-04-21 21:08:38 +02:00
fb0ba1d8bc Remove unused variable 2017-04-21 21:08:03 +02:00
5d4ef8ed7f Merge pull request #910 from matthiasbeyer/libimagstore/non-consuming-update
Libimagstore/non consuming update
2017-03-08 15:30:19 +01:00
89b08d77aa Fix: Make appropriate variables mutable here 2017-03-08 12:47:40 +01:00
1c43abb0b0 Fix for new Store::update() interface 2017-03-08 12:47:40 +01:00
c8faf5a6a9 Use ::fold_defresult() instead of ::fold() 2017-02-27 12:32:49 +01:00
a53547e08a Change Store::update() to be non-consuming 2017-02-26 19:54:40 +01:00
ef07c2cba9 Merge pull request #897 from matthiasbeyer/libimagstore/verify-panic
Libimagstore/verify panic
2017-02-23 14:42:39 +01:00
2d199ce3ec Trace errors and then panic, if configured 2017-02-23 12:34:36 +01:00
602bdd9762 Doc for Store::execute_hooks_for_mut_file() 2017-02-20 16:05:17 +01:00
0c3cea692f Doc for Store::execute_hooks_for_id() 2017-02-20 16:05:07 +01:00
77d5fcc2d0 Doc for Store::save_as() 2017-02-20 16:04:54 +01:00
671f19043d Doc for Store::save_to() 2017-02-20 16:04:49 +01:00
f129358999 Doc for Store::delete() 2017-02-20 16:04:36 +01:00
c82d7bf7bc Doc for Store::retrieve_copy() 2017-02-20 16:04:28 +01:00
1f47db3951 Doc for Store::_update() 2017-02-20 16:04:17 +01:00
c8c8401680 Doc for Store::update() 2017-02-20 16:04:04 +01:00
77b10e20cb Doc for Store::walk() 2017-02-20 16:03:56 +01:00
8d855f4c78 Doc for Store::retrieve_for_module() 2017-02-20 16:03:45 +01:00
4e042e4de2 Doc for Store::get() 2017-02-20 16:03:32 +01:00
8867e50618 Doc for Store::retrieve() 2017-02-20 16:03:24 +01:00
8896bbb4c5 Doc for Store::create() 2017-02-20 16:03:11 +01:00
84dc385749 Doc for Store::new() 2017-02-20 16:03:03 +01:00
e26a23420a Doc for Store object type 2017-02-20 16:02:49 +01:00
93ca8f7046 Add documentation for Entry type 2017-02-20 15:18:19 +01:00
356c17d98b Add documentation for FileLockEntry 2017-02-20 15:18:08 +01:00
12e07b32d4 Add documentation for store functions 2017-02-20 15:17:55 +01:00
33f4b33d61 Remove scope and indentation level 2017-02-19 12:38:43 +01:00
aea81e5df5 Remove unnecessary call 2017-02-19 12:38:43 +01:00
6f1a510c70 Add more detailed expl on feature, including warning 2017-02-05 13:10:39 +01:00
e8f4a9089a Add feature to compile early panics
Do debug printing when drop of FileLockEntry failed.
2017-02-05 13:10:39 +01:00
26b1b8e84c toml_ext::has_imag_version_in_main_section() must be pub to be used in tests 2017-02-05 13:10:38 +01:00
58a42d127d Minify impl of has_main_section() 2017-02-05 13:10:38 +01:00
95105986b1 Minify impl of has_only_tables() 2017-02-05 13:10:38 +01:00
f1c1a1f9be Eliminate EntryHeader type
Therefor introduce the "Header" trait which is implemented on Value for
backwards compatibility.

Make the default_header() function publicly available as
Entry::default_header()
2017-02-05 13:10:38 +01:00
0e01a1ef4e Fix backwards-incompatibilities of regex crate 2017-01-30 11:15:20 +01:00
6e47ce8de7 Update regex to 0.2.* 2017-01-30 08:06:57 +01:00
4db44a209f Remove unused fn 2017-01-25 18:34:34 +01:00
710d9f7b03 Remove unused variables 2017-01-25 18:34:28 +01:00
mario
8df5519f34 Move [profile.dev] codegen-units = 2 to top-level Cargo.toml
lower level (=package/crate level) definitions for profiles are ignored
2017-01-19 20:08:51 +01:00
91fca4ba13 Update dependencies 2016-11-30 09:36:45 +01:00
ecfe78d87b Move tests to new module 2016-11-14 15:28:57 +01:00
847b65f3b0 We dont need to clone() here 2016-11-14 15:01:24 +01:00
6f79e6e007 Add helper trait for extracting from Array/Table 2016-11-14 15:00:11 +01:00
bdc9318a41 Remove unreachable statements 2016-11-14 14:52:53 +01:00
a9e4148032 Refactor unpacking into helper fn 2016-11-14 14:52:53 +01:00
6a8273808a Refactor to use try!() instead of match{}ing 2016-11-14 14:52:51 +01:00
79f68a1b79 Prettify codebase 2016-11-14 14:52:51 +01:00
35cfb5d651 Use helper fns to prettify error building 2016-11-14 14:52:51 +01:00
dab6ad0f20 Use default parameters from underlying functions 2016-11-14 14:52:51 +01:00
2a04da9b3f Add EntryHeader::delete_with_sep() 2016-11-14 14:52:51 +01:00
7cfff0f0d8 Minify EntryHeader code 2016-11-14 14:52:51 +01:00
5470ffceac Extract TOML extension to own module 2016-11-14 14:52:50 +01:00
303dd30ff2 impl PartialEq for Entry 2016-11-03 18:47:11 +01:00
5d2bc65623 We can derive PartialEq for EntryHeader 2016-11-03 18:47:02 +01:00
0a04081599 Merge pull request #656 from matthiasbeyer/cargo-rustc-codegen-units
Cargo rustc codegen units
2016-10-31 23:39:38 +01:00
aa0f496474 Impl PartialEq for StoreId 2016-10-31 14:38:05 +01:00
5ad2bfc462 libimagstore/Cargo.toml: Update dependencies 2016-10-24 14:30:54 +02:00
df6de8e957 Add codegen-units = 2 in ./libimagstore/Cargo.toml 2016-10-24 13:51:17 +02:00
b5bfc1978c Fix: Cargo.toml does not know "website", but "homepage" 2016-10-20 14:14:18 +02:00
4ee505c658 Merge pull request #815 from matthiasbeyer/release-prep
Release preparation things
2016-10-19 14:33:11 +02:00
3567606008 Merge pull request #816 from matthiasbeyer/libimagstore/test-storeid-name-fix
Fix test StoreId name
2016-10-18 20:52:42 +02:00
fc464446a9 Fix test StoreId name
The name of the storeid was duplicated, which caused the tests to fail
from time to time.

This patch fixes the name of the entry which is used to test.
2016-10-18 15:41:01 +02:00
2a514c16e6 Add meta-info in libimagstore/Cargo.toml 2016-10-18 10:56:12 +02:00
ff4a96ff59 Add missing "use" 2016-10-15 15:49:01 +02:00
da408f60fd Refactor iflet into and_then().or_else() 2016-10-15 15:49:01 +02:00
3fe8ec5d33 Simplify line 2016-10-15 15:49:00 +02:00
3d572dda0f Reimplement StoreId::to_str() to remove unwrap() 2016-10-15 15:49:00 +02:00
52367edc83 Remove unwrap()s in file abstraction code 2016-10-15 15:49:00 +02:00
c0eb329abf Simplify hashmap fetching and error construction 2016-10-15 15:49:00 +02:00
2363d6ba30 Use try!() instead of unwrapping errors 2016-10-15 15:49:00 +02:00
e8ae4c0da7 Create symlinks to documentation files in libimag*/README.md 2016-10-13 12:04:36 +02:00
e30d774670 Move all libimag*/README.md to doc/src/05100-* 2016-10-13 12:04:36 +02:00
10b920a149 Merge branch 'libimagstore/store-tests' into libimagstore/store-tests-integration 2016-10-12 11:13:38 +02:00
2cbcfa946c Merge branch 'master' into libimagstore/store-tests-integration
On master, we changed the Store::update() function to do nothing more
than calling Store::_update() and wrapping an error.

On the libimagstore/store-tests branch, we modified the
Store::_update() function to contain an additional flag in the
parameters, whether the File-Lock-Entry internal `precense`-value should
be updated.

This merge commit resolves that conflict.
2016-10-12 08:53:11 +02:00
b4d2f5c1a6 Each test should test with a unique test file name 2016-10-12 08:38:07 +02:00
600059be82 Add error output 2016-10-12 08:38:07 +02:00
27e816fc69 Do not simply unwrap, but return error in case of error 2016-10-12 08:38:07 +02:00
9a8a2f1c29 Add hook tests for hooks that error with an error that does not abort the action 2016-10-09 18:26:16 +02:00
7050067675 Merge pull request #761 from matthiasbeyer/libimagstore/store-tests-more-succeeding-hook-tests
libimagstore/store-tests: more succeeding hook tests
2016-10-09 13:29:48 +02:00
5202c5112a Add flag for _update() whether precense should be modified
This is a bugfix for an very particular issue.

Here's what happens:

If we create() an FileLockEntry and then update() it, we are running
into a problem because update() calls _update() which changes the
precense status of a FileLockEntry.

Because update() is _consuming_, the FileLockEntry gets drop()ed
afterwards. This _again_ causes _update() to be called, but with a new
presence status, which is not true in this moment (as the FileLockEntry
is still borrowed, but we already marked it as present).

This patch is a short-term fix. The real problem is, that our Store
interface is consuming. If the Store interface would be non-consuming,
this issue wouldn't happen, as the drop() call would not happen.

I'm rather sure that this patch will not be reverted in the process of
rewriting the Store interface to be non-consuming. But we never know.
2016-10-07 21:59:37 +02:00
7b11e7dabb Add testing implementation for Drop for FileLockEntry 2016-10-07 21:59:37 +02:00
d375a6d2c6 Add output to test helper, so we can see in the trace whats happening 2016-10-07 21:59:37 +02:00
ae66b00f5f store tests: Add erroring-hook-tests 2016-10-07 21:59:37 +02:00
095ae19416 [CHERRY-PICK] Add flag for _update() whether precense should be modified
This is a bugfix for an very particular issue.

Here's what happens:

If we create() an FileLockEntry and then update() it, we are running
into a problem because update() calls _update() which changes the
precense status of a FileLockEntry.

Because update() is _consuming_, the FileLockEntry gets drop()ed
afterwards. This _again_ causes _update() to be called, but with a new
presence status, which is not true in this moment (as the FileLockEntry
is still borrowed, but we already marked it as present).

This patch is a short-term fix. The real problem is, that our Store
interface is consuming. If the Store interface would be non-consuming,
this issue wouldn't happen, as the drop() call would not happen.

I'm rather sure that this patch will not be reverted in the process of
rewriting the Store interface to be non-consuming. But we never know.
2016-10-07 21:18:49 +02:00
cf50ddae33 [CHERRY-PICK] Add testing implementation for Drop for FileLockEntry 2016-10-07 21:18:49 +02:00
485d280236 Bugfix: The StoreEntry should know the _new_ StoreId
When moving a entry in the store, we also should tell the StoreEntry
the new id.
2016-10-07 21:18:49 +02:00
c72291159e Add comment/documentation for Store::move_by_id() 2016-10-07 17:53:11 +02:00
b189bf7b8c Add check if entry is present
If we try to rename an entry that is borrowed, we fail, as renaming an
borrowed entry might result in some _really_ ugly bugs.
2016-10-07 17:32:35 +02:00
1e83ad7bbd Add test for hook execution for each hook position 2016-10-07 17:32:35 +02:00
d9f4898a3a Abstract testing of hook execution in helper function 2016-10-07 17:32:35 +02:00
dd621a08a6 Merge pull request #772 from matthiasbeyer/libimagstore/store-tests-erroring-hooks
libimagstore/store-tests: erroring hooks
2016-10-06 18:30:24 +02:00
1244a6666f Add assert to Store::get() the new ID 2016-10-03 12:34:07 +02:00
6cc1a90870 libimagstore: Add copyright notice to all files 2016-10-01 17:35:06 +02:00