Commit Graph

272 Commits (master)

Author SHA1 Message Date
Sébastien Helleu 6d9a247df3 tests: add eval tests with invalid values for "repeat:" 2020-01-27 23:04:24 +01:00
Sébastien Helleu 1914ceb74f tests: add eval tests with invalid values for "cut:" and "cutscr:" 2020-01-27 23:04:22 +01:00
Sébastien Helleu 34bb43379a tests: add eval test with invalid value for "hide:" 2020-01-27 21:21:01 +01:00
Sébastien Helleu 070e86bd6e tests: add eval test with invalid regex group 2020-01-27 21:17:17 +01:00
Sébastien Helleu 1d77b9742e tests: add evaluation tests with ternary operator and escape of prefix ("$") 2020-01-27 21:09:54 +01:00
Sébastien Helleu d91d1ebb8c tests: add other calc tests with multiple operators
The order of operators are different from the initial test, so this increases
the code coverage in wee-calc.c.
2020-01-27 20:54:23 +01:00
Sébastien Helleu feb6258910 core: update copyright dates 2020-01-04 10:41:26 +01:00
Sébastien Helleu e612e63140 core: fix evaluation of condition with nested "if" (closes #1434) 2019-12-18 21:22:36 +01:00
Sébastien Helleu 3dab07d659 tests: add unit tests on hash algorithms with salt (issue #635) 2019-11-25 23:02:05 +01:00
Sébastien Helleu 8fc8f728d4 core: add reverse of string for screen in evaluation of expressions with "revscr:" 2019-10-12 20:14:36 +02:00
Sébastien Helleu 88aa82d672 core: add support of modifiers in evaluation of expressions with "modifier:name,data,string" (issue #60) 2019-10-06 09:13:35 +02:00
Sébastien Helleu 90f711a965 core: add function to convert WeeChat colors to ANSI colors (issue #528) 2019-10-01 18:31:41 +02:00
Sébastien Helleu 177fa6c528 core: add support of reverse video in ANSI color codes 2019-10-01 18:31:41 +02:00
Sébastien Helleu a8ca4b5b3a tests: add tests on GUI color functions 2019-10-01 18:31:41 +02:00
Sébastien Helleu baf8f635ff core: fix style in CMake files 2019-10-01 18:31:41 +02:00
Sébastien Helleu ae38b11407 irc: add "user" in output of irc_message_parse (closes #136) 2019-09-27 20:52:00 +02:00
Sébastien Helleu 3a356f109f core: add power operator "**" in calc expressions (issue #997) 2019-09-24 21:03:56 +02:00
Sébastien Helleu 7d795c4d53 core: fix wrong results with the unary minus in calc expressions 2019-09-24 20:49:48 +02:00
Sébastien Helleu e1a4612797 core: ignore color codes in ${length:xxx} and ${lengthscr:xxx} 2019-09-21 13:54:36 +02:00
Sébastien Helleu dcfc4e8ed5 core: add "length:xxx" and "lengthscr:xxx" in evaluation of expressions 2019-09-21 07:56:21 +02:00
Sébastien Helleu 997894edc0 core: add calculation of expression in evaluation of expressions with "calc:..." (issue #997) 2019-09-20 21:37:01 +02:00
Tobias Stoeckmann f7b84fcc67 Fixed segfault during excessive evaluation.
It is possible to trigger a segmentation fault while processing
an evaluation of repeating string. On a Linux 64 bit system,
enter this (or adjust arguments for 32 bit accordingly):

/eval -n ${repeat:1073741824,----}

It will overflow an integer calculation because int instead of
size_t is used. Proper check of int limitations fixes this issue.

I haven't changed this specific piece of code to size_t because it
would crash in other parts of the code tree instead. For now, int
is a limitating factor when it comes to strings (and should be
enough for sane use cases).

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-09-17 21:26:52 +02:00
Sébastien Helleu 608ec9f483 core: add values djb2_32 and sum_32 for option weechat.look.nick_color_hash (issue #1394) 2019-08-20 21:20:33 +02:00
Sébastien Helleu 7f62985f89 core: use fixed-width integer for computing hashtable DJB2 key hash (closes #1394) 2019-08-19 23:29:22 +02:00
Sébastien Helleu 80f103b68a core: use fixed-width integer for computing nick hash (issue #1394) 2019-08-19 23:27:11 +02:00
Andrew Potter 0957231d30 api: add function list_user_data (issue #666) 2019-08-10 12:55:43 +02:00
Sébastien Helleu b4215ee466 tests: add tests on IRC function irc_nick_is_nick 2019-08-06 22:13:10 +02:00
Sébastien Helleu b6cc5ef70f irc: fix length of user/nick/host in split of messages (closes #1387) 2019-08-04 16:39:18 +02:00
Sébastien Helleu 59ba378eec tests: add missing space after name of function 2019-08-04 14:39:58 +02:00
Sébastien Helleu 4fa62a83f1 tests: add unit tests on IRC functions irc_message_split* (issue #1387) 2019-08-04 14:39:58 +02:00
Sébastien Helleu 067f237ec3 tests: add unit tests on IRC function irc_message_convert_charset 2019-08-04 14:04:45 +02:00
Sébastien Helleu c46255b1d0 tests: add unit tests on IRC functions irc_message_parse and irc_message_parse_to_hashtable 2019-08-03 13:57:50 +02:00
Sébastien Helleu d79e0cbd31 tests: add unit tests on IRC function irc_message_replace_vars 2019-08-03 11:34:42 +02:00
Sébastien Helleu 28d79d0c93 tests: add unit tests on IRC functions irc_message_get_{nick,address}_from_host 2019-08-03 11:30:35 +02:00
Sébastien Helleu 82a92bd4e9 irc: add unit tests on ignore functions 2019-07-10 19:20:09 +02:00
Sébastien Helleu 9178156354 api: add argument "strip_items" in function string_split 2019-06-15 20:47:14 +02:00
Sébastien Helleu 866a29c7e6 core: check that string pointer is not NULL in function "string_shared_get" 2019-06-15 17:21:06 +02:00
Sébastien Helleu 2073408b86 irc: fix parsing of MODE command when there are colons after the first mode argument (closes #1296) 2019-05-10 19:29:58 +02:00
Sébastien Helleu ece92efd81 tests: add link with iconv library (if found)
This fixes a compilation error on FreeBSD.
2019-04-20 10:15:01 +02:00
Sébastien Helleu 6fa4494aae tests: add test with multiple wildcards in call to function string_match 2019-04-01 00:18:21 +02:00
Sébastien Helleu 5d02ff9a6d tests: add tests on function util_signal_search 2019-04-01 00:15:25 +02:00
Sébastien Helleu d2571ab53b tests: add tests on util_timeval functions 2019-04-01 00:07:32 +02:00
Sébastien Helleu 709334eede tests: add tests on function util_parse_delay with unit "ms" (milliseconds) 2019-04-01 00:02:49 +02:00
Sébastien Helleu fa5b1eed77 core: move parsing of /wait delay in a separate function, with unit tests 2019-03-29 20:17:26 +01:00
Sébastien Helleu 2f37de9148 core: make "input_commands_allowed" work with /wait and /repeat commands (issue #928) 2019-03-28 18:45:22 +01:00
Sébastien Helleu c713a0e475 tests: fix scripting API tests on 32-bit arch
The problem is that on 32-bit arch (like GNU/Hurd), the number 42000000000000
is converted to 42000000000000L in Python, which is causing troubles in other
languages like Perl.

The fix is to use a smaller number. Such large size for function
string_format_size is tested in the C++ test suite anyway.
2019-03-25 00:18:55 +01:00
Sébastien Helleu b04d8934ee tests: fix style in CMake file 2019-03-24 13:43:19 +01:00
Sébastien Helleu 2612adf899 core: add CMake option "ENABLE_CODE_COVERAGE" to compile with code coverage options
This option is OFF by default and should be enabled only for tests, to measure
test coverage.
2019-03-24 09:38:43 +01:00
Sébastien Helleu 34bf68d38e tests: remove extra output before/after tests 2019-03-23 20:08:17 +01:00
Sébastien Helleu 766bea3f9e tests: remove value for first #define in headers 2019-03-19 20:33:30 +01:00
Sébastien Helleu 2b70d71aa1 core: replace argument "keep_eol" by "flags" in function string_split (closes #1322) 2019-03-10 18:29:16 +01:00
Sébastien Helleu 8aa5f5375e core: add value -1 for keep_eol in function string_strip (issue #1322)
The value -1 means it's a standard split, but empty items are kept, and
separators are not removed at beginning/end of string.
2019-03-09 21:56:05 +01:00
Sébastien Helleu 80b980b2af api: add function command_options (issue #928) 2019-02-28 20:19:18 +01:00
Sébastien Helleu c2859096cb api: add function string_match_list 2019-02-27 07:46:22 +01:00
Sébastien Helleu 57aa9e060e spell: rename "aspell" plugin to "spell" (issue #1299)
The following things have been renamed:

- file aspell.conf -> spell.conf
- options aspell.* -> spell.*
- bar item aspell_dict -> spell_dict
- bar item and local variable aspell_suggest -> spell_suggest
- info aspell_dict -> spell_dict
2019-02-19 21:15:56 +01:00
Sébastien Helleu 73a4901fe1 tests: fix evaluation tests on FreeBSD
The following special sequences are not supported in regular expressions on
FreeBSD:

- "\w": replaced with "[a-zA-Z0-9_]"
- "\S": replaced with "[^ ]" (it should be "[^ \t\n\r\f\v]", but in practice
  only spaces could be a problem when we use this sequence).
2019-01-26 10:00:47 +01:00
Sébastien Helleu 507dfec781 tests: fix UTF-8 tests on FreeBSD
Tests for size on screen are made on U+2EE9 (CJK Radical Simplified Yellow)
instead of U+24B62 (CJK Unified Ideograph-24B62) which returns a length of 1 on
FreeBSD and 2 on Linux.
2019-01-26 09:57:30 +01:00
Sébastien Helleu eb0828ec6c tests: fix link of tests on GNU Hurd and FreeBSD 2019-01-20 16:53:00 +01:00
Sébastien Helleu 142d312ad7 tests: add missing include of stdio.h 2019-01-20 15:59:04 +01:00
Sébastien Helleu 98249ada86 tests: add tests on IRC color functions
Functions tested:

- irc_color_decode
- irc_color_encode
- irc_color_decode_ansi
2019-01-20 15:17:21 +01:00
Sébastien Helleu 34a6fce134 tests: add tests on function irc_protocol_parse_time 2019-01-13 14:47:35 +01:00
Sébastien Helleu c96e2f3593 tests: add tests on function irc_config_check_autojoin 2019-01-11 22:27:28 +01:00
Sébastien Helleu 2b0057239b core: update copyright dates 2019-01-01 15:40:51 +01:00
Sébastien Helleu 4712d0bb06 core: use https for links to GNU GPL license 2018-11-29 23:16:07 +01:00
Sébastien Helleu d8ad7e6a8d tests: add missing file test-secure.cpp in autotools 2018-11-04 15:03:54 +01:00
Sébastien Helleu ed3f281ba9 api: add functions string_base_{encode,decode}, remove functions string_{encode,decode}_base64 2018-11-04 14:49:11 +01:00
Sébastien Helleu 6d72868e15 api: return integer in function string_encode_base16 2018-11-02 14:20:16 +01:00
Sébastien Helleu 8848b0e22a api: return integer in function string_encode_base64 2018-11-02 14:09:23 +01:00
Sébastien Helleu 74a17d821f tests: add tests on functions secure_encrypt_data and secure_decrypt_data 2018-11-02 14:06:14 +01:00
Sébastien Helleu d0ea801724 core: add support of TOTP generation/validation (Time-based One-Time Password) 2018-11-02 14:06:14 +01:00
Sébastien Helleu 8da3458f4c core: add repeat of string in evaluation of expressions with "repeat:count,string" (closes #958) 2018-10-09 21:12:02 +02:00
Sébastien Helleu 82697714e1 core: fix evaluation of nested ternary operators (closes #1263) 2018-10-08 22:51:08 +02:00
Sébastien Helleu 1ff9d1f52a core: add missing slash at the end of weechat.org URLs 2018-09-09 10:00:53 +02:00
Sébastien Helleu 796859b873 core: fix copyright dates 2018-09-01 08:13:12 +02:00
Sébastien Helleu 6bf0dfddd6 core: fix evaluation of condition when the left operand is an empty string 2018-08-18 15:30:16 +02:00
Sébastien Helleu 466dbbe75b core: add option "-P" (or "--plugins") to customize the plugins to load at startup
If given, the option replaces the option weechat.plugin.autoload.
2018-08-17 19:44:41 +02:00
Sébastien Helleu 1a0087a7d7 core: fix string evaluation with regex replacement when the string is empty 2018-08-16 22:45:42 +02:00
Sébastien Helleu ca90f28beb tests: add tests on modifier hook 2018-08-16 18:27:04 +02:00
Sébastien Helleu 057f2c3396 tests: properly initialize variable argc before tests on function string_split 2018-08-15 09:43:35 +02:00
Sébastien Helleu cdc7faf93f tests: add test on function string_split with a string having only delimiters 2018-08-15 09:42:59 +02:00
Sébastien Helleu 12a6f74ec0 core: fix check of tags in lines
All changes:
- fix check of tags in lines: check lines without tags, fix check of tags with
  negation ("!tag")
- add string functions string_split_tags and string_free_split_tags
- add tests on function gui_line_match_tags
2018-08-12 20:30:13 +02:00
Sébastien Helleu e0cecefb0f tests: fix compiler warnings on calls to snprintf 2018-07-13 22:35:39 +02:00
Sébastien Helleu 1abf4040f1 core: add reverse of string in evaluation of expressions with "rev:" (closes #1200) 2018-06-02 16:01:14 +02:00
Sébastien Helleu ab9a0ec2e6 tests: add missing tests on function string_cut 2018-06-02 15:19:16 +02:00
Sébastien Helleu ba19fa9963 core: count number of chars instead of bytes for suffix in function string_cut 2018-06-02 15:18:29 +02:00
Sébastien Helleu 49253bd4d9 tests: fix test of function utf8_strlen_screen on Han char (U+24B62) 2018-06-02 14:42:29 +02:00
Sébastien Helleu afb1d03053 Merge remote-tracking branch 'origin/pr/623' into irc-3.2-cap 2018-05-20 15:21:07 +02:00
Sébastien Helleu ba13d764e6 tests: add tests on eval_expression() with different prefix/suffix 2018-04-17 20:26:45 +02:00
Sébastien Helleu c1dee726d5 tests: turn off memory leak detection only when testing javascript API 2018-04-13 20:57:34 +02:00
Sébastien Helleu 3c97a1abae tests: fix typo in language name 2018-04-13 20:53:34 +02:00
Sébastien Helleu cc06b95ba7 tests: add tests on infolists 2018-04-12 19:47:42 +02:00
Sébastien Helleu 5ae557fa52 tests: fix AST return in TCL 2018-04-11 23:20:12 +02:00
Sébastien Helleu b2344fe5d6 tests: fix AST return in PHP 2018-04-11 23:10:46 +02:00
Sébastien Helleu cb4348df61 tests: fix AST return in Perl 2018-04-11 23:02:02 +02:00
Sébastien Helleu 6de98179bc api: add function string_format_size in scripting API 2018-04-07 13:20:58 +02:00
Sébastien Helleu 9be08943ab tests: fix name of target in dependencies 2018-03-16 22:08:11 +01:00
Sébastien Helleu 805717e9ec core: add binary weechat-headless to run WeeChat without interface (closes #1120)
The optional command line option "--daemon" runs WeeChat like a daemon
(fork, new process group, file descriptors closed).
2018-03-11 09:59:39 +01:00
Sébastien Helleu 688c9d92d0 tests: fix typo in fake ncurses lib header 2018-03-09 07:35:40 +01:00
Sébastien Helleu be7002b70d tests: fix tests on function string_regex_flags 2018-01-07 15:04:24 +01:00
Sébastien Helleu ed4837b2f6 core: update copyright dates 2018-01-05 00:54:18 +01:00