1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-21 06:56:48 +02:00
Commit Graph

247 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema
a0d60d23b0 compat: include sys/wait.h where needed
netbsd needs this explicitly, other systems let us get away without it.
2024-04-21 22:08:10 +03:00
Dirk-Jan C. Binnema
29ce96923a test-mu-utils: update parse_date_time tests
We're using ::time_t now.
2024-04-14 11:30:20 +03:00
Dirk-Jan C. Binnema
a6ec43a740 mu-utils: update casting from int64_t -> time_t
Esp. for systems with 32-bit time_t.
2024-04-13 20:06:39 +03:00
Dirk-Jan C. Binnema
4a03a30d04 utils: build test-utils when tests are not disabled
Fixes #2685
2024-04-08 18:29:57 +03:00
Dirk-Jan C. Binnema
5186264852 utils: only build mu-tests-utils when tests are enabled
This fixes a compilation failure.

Fixes #2684.
2024-04-06 10:36:18 +03:00
Matthew Smith
45b4f60348 mu-utils: Fix build with musl
In musl, `stdout` is a macro that expands to `(stdout)`, and
`::(stdout)` is not valid C++.

../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected
  id-expression before '(' token
 268 |                              ::stdout);
     |                                ^~~~~~

Nothing in the Mu namespace is named stdout, so it is safe to drop
the `::`.

Bug: https://bugs.gentoo.org/928361
2024-04-01 11:23:39 +00:00
Dirk-Jan C. Binnema
9fd0d2be12 clang: fix some compiler warnings
From CI.
2024-03-15 19:47:30 +02:00
Dirk-Jan C. Binnema
915335fd76 tests: check setlocale return value
It might fail while nl_langinfo does not.
2024-02-25 17:11:29 +02:00
Dirk-Jan C. Binnema
30b8238522 tests: move to tests/, make optional
While not recommended, sometimes it can be useful to disable building
the unit tests. This can be done now with
    meson -Dtests=disabled build
2024-01-06 18:35:22 +02:00
Dirk-Jan C. Binnema
b4c768e6d0 mu-init: guess maildir when --maildir is missing
Re-instate the guessing that's in the manpage. Add unit tests.
Update documentation.

Fixes #2616.
2024-01-01 10:33:03 +02:00
Dirk-Jan C. Binnema
25776da557 mu-result: small tweaks 2023-12-13 21:48:43 +02:00
Dirk-Jan C. Binnema
fcd89039eb expand_path: better handle paths with spaces
I.e., work around surprising behavior of wordexp

Fixes #2566.
2023-10-07 00:18:56 +03:00
Dirk-Jan C. Binnema
ee18c02762 maildir: improve unit tests
And get some more info from run_command.
2023-09-24 21:33:18 +03:00
Dirk-Jan C. Binnema
4a0eba8ddf improve unit tests 2023-09-24 20:21:57 +03:00
Dirk-Jan C. Binnema
e16e1f78ce command-handler: more unit tests 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema
fa22fc28d9 error: more unit tests 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema
abb0fb4fd5 utils/add: improve unit test coverage 2023-09-24 17:29:56 +03:00
Dirk-Jan C. Binnema
11003000e8 mu: log warning when exiting with error 2023-09-23 09:26:37 +03:00
Dirk-Jan C. Binnema
04e3a2f9a8 mu-utils: improve tests 2023-09-21 23:41:15 +03:00
Dirk-Jan C. Binnema
6ce94ce914 mu-utils: add to_string_view 2023-09-21 23:41:15 +03:00
Dirk-Jan C. Binnema
24add72126 mu-file-utils: add run_command0
To ensure command ran and had exit-code=0 in one go.
2023-09-19 22:26:45 +03:00
Dirk-Jan C. Binnema
472f69beb2 utils-file: default args for canonicalize_filename / determine_dtype
Make a little easier to use
2023-09-19 22:26:30 +03:00
Dirk-Jan C. Binnema
7cbab21099 utils: add utf8_wordbreak
Determine if a string has wordbreaks in a mostly Xapian-compatible way.
We need this to determine what strings should be considered "phrases".
2023-09-17 18:11:10 +03:00
Dirk-Jan C. Binnema
3123f3e983 mu-error: allow for adding end-user hints 2023-09-16 11:12:16 +03:00
Dirk-Jan C. Binnema
0a12b70d7b utils-file: improve mu_play
implement in terms of run_command
2023-09-13 23:03:51 +03:00
Dirk-Jan C. Binnema
9dcbe1d96c lib: unit tests: improve / better coverage 2023-09-13 23:02:53 +03:00
Dirk-Jan C. Binnema
7c16d080d2
Merge pull request #2552 from dme/devel/misc
mu: Fix "expected command" server error report
2023-09-12 22:28:30 +03:00
David Edmondson
a8440bb258 mu: Fix "expected command" server error report 2023-09-12 08:37:10 +01:00
Dirk-Jan C. Binnema
af9eb36ca0 unit-tests: modernize
Use TempDir, join_paths etc.
2023-09-11 23:51:37 +03:00
Dirk-Jan C. Binnema
85ad35bd8e utils/unbroken: avoid pre-C++20 compiler warning 2023-09-10 10:15:33 +03:00
Dirk-Jan C. Binnema
c8568eecd4 utils/file: add basename/dirname helpers and use them 2023-09-10 10:15:28 +03:00
Dirk-Jan C. Binnema
264bb092f0 support xapian ngrams
Xapian supports an "ngrams" option to help with languages/scripts
without explicit wordbreaks, such as Chinese / Japanese / Korean.

Add some plumbing for supporting this in mu as well. Experimental for
now.
2023-09-09 17:26:20 +03:00
Dirk-Jan C. Binnema
9c28c65d45 utils: handle "unbroken" scripts
Do not removing combining characters from scripts without explicit word
boundaries, such as those for CJK.

Reuse some Xapian code for that.
2023-09-09 11:40:36 +03:00
Dirk-Jan C. Binnema
77a8a67f6c move lib/thirdparty to thirdparty/ 2023-09-05 08:34:27 +03:00
Dirk-Jan C. Binnema
e1308a9b40 utils: small tweaks 2023-08-27 11:07:55 +03:00
Dirk-Jan C. Binnema
c1950ae0cb mu-utils: support UTC in parse_date_time
Parsing dates known to be in UTC.
2023-08-21 18:29:21 +03:00
Dirk-Jan C. Binnema
15f08488d3 remove Mu::format, use mu_format
Use the new fmt-based formatting.
2023-08-19 20:04:50 +03:00
Dirk-Jan C. Binnema
11df0bedce utils: add mu_print[ln] for ostreams 2023-08-11 19:57:00 +03:00
Dirk-Jan C. Binnema
7aa38d0b56 option/result: add "unwrap"
Sprinkle some more Rust on Option & Result
2023-08-09 23:24:47 +03:00
Dirk-Jan C. Binnema
4ecf386cda utils-file: don't use regexp in join_paths
It's slow.
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema
27c07280b1 utils: replace time_to_string with fmt-based formatting
It's faster; make "mu find" ~5-10% faster, and removes some code we no
longer need.
2023-08-06 16:19:43 +03:00
Dirk-Jan C. Binnema
111e48efa3 utils: add expand_path (wordexp wrapper)
For expanding command-line options for shells that don't do that by themselves.
2023-08-03 22:47:27 +03:00
Dirk-Jan C. Binnema
33fd79a9f0 mu-regex: add multiline test 2023-07-30 00:50:45 +03:00
Dirk-Jan C. Binnema
3a38d6366a mu-view: test locale to C for tests 2023-07-29 17:25:07 +03:00
Dirk-Jan C. Binnema
766d1849ff test-utils: add TempTz, RAII temporary timezone 2023-07-29 16:39:08 +03:00
Dirk-Jan C. Binnema
1f0342a91f mu-view: add unit-test 2023-07-28 19:43:46 +03:00
Dirk-Jan C. Binnema
dc29dc8395 html-to-text: add missing include <array> 2023-07-26 23:30:54 +03:00
Dirk-Jan C. Binnema
c06e765d13 html-to-text: be explicit with array type
clang in CI fails to deduce it, so let's help it a bit.
2023-07-26 23:24:29 +03:00
Dirk-Jan C. Binnema
56b8fad89e utils: implement html-to-text
Implement a crude html-to-text scraper function, to extract plain text
from html messages, so we can use it for indexing.
2023-07-25 21:26:36 +03:00
Dirk-Jan C. Binnema
11c807f955 utils/readline: use fmt-based apis 2023-07-25 21:26:01 +03:00