264 Commits

Author SHA1 Message Date
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
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
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
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
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
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
cc06b95ba7 tests: add tests on infolists 2018-04-12 19:47:42 +02: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
Sébastien Helleu
1d56e17b2f core: allow floating point and hexadecimal numbers in comparison of evaluated values 2017-10-17 20:43:40 +02:00
Sébastien Helleu
8a32249507 javascript: fix detection of libv8 with autotools on Ubuntu Trusty 2017-10-07 21:43:18 +02:00
Sébastien Helleu
e317a6856c tests: add PHP plugin in tests 2017-09-03 21:49:48 +02:00
Sébastien Helleu
c65137667b tests: improve tests on dynamic strings 2017-08-20 11:26:23 +02:00
Sébastien Helleu
b879df09b5 tests: check that fset plugin is loaded 2017-06-25 16:35:28 +02:00
Simmo Saan
0a4be02dc3 core: add hashtable_add_from_infolist to API 2017-06-17 20:03:40 +03:00
Simmo Saan
1329dfb57a core: add wildcard matching operators to eval (closes #608) 2017-04-29 17:04:44 +02:00
Sébastien Helleu
5b78cb2a7b tests: fix compilation warning on FreeBSD 2017-04-26 22:28:03 +02:00
Sébastien Helleu
112bebcddf core: add a way to count the suffix length in max chars displayed in cut of string ("cut:" and "cutscr:") (closes #963)
The format to use is one of:

- ${cut:+max,suffix,string}
- ${cutscr:+max,suffix,string}

With the "+" before max, WeeChat ensures there are at most "max" chars in
output, including the length of suffix string.
2017-04-24 22:37:49 +02:00
Sébastien Helleu
94355e2e38 core: ensure length is not negative in function string_strndup 2017-04-22 15:15:54 +02:00
Sébastien Helleu
6ab7af705e tests: fix tests on dynamic strings 2017-04-01 12:16:12 +02:00
Sébastien Helleu
bb00b6b8fb core: add ${re:#} to get the index of last group captured in evaluation of expressions 2017-03-30 22:13:14 +02:00
Sébastien Helleu
467f482ea6 core: make "callback_cmp" optional in call to function arraylist_new()
If no callback is given, a default callback is used, which just compares
pointers.
2017-03-30 20:35:16 +02:00
Sébastien Helleu
eb2d0ac58a tests: add tests on combining characters in cut/cutscr (evaluation of expression) 2017-03-28 22:09:11 +02:00
Sébastien Helleu
3045021430 core: fix cut of chars in "cutscr" of evaluated strings
This fixes two problems:
- stop before max char displayed with wide chars
- preserve combining chars in the output

Before the fix (wrong):

>> ${cutscr:3,+,こんにちは世界}
== [こん+]
>> ${cutscr:1,+,a${\u0308}}
== [a+]

After the fix (OK):

>> ${cutscr:3,+,こんにちは世界}
== [こ+]
>> ${cutscr:1,+,a${\u0308}}
== [ä]
2017-03-28 20:45:31 +02:00
Sébastien Helleu
f99c866f35 core: add cut of string with max chars displayed in evaluation of expressions
The syntax is: ${cutscr:max,suffix,string}.
The string is cut after max chars displayed on screen. If the string is cut,
the optional suffix is added after.
2017-03-27 21:14:51 +02:00
Sébastien Helleu
9a8ec36cbd core: add cut of string in evaluation of expressions
The syntax is: ${cut:max,suffix,string}.
The string is cut after max chars. If the string is cut, the optional suffix is
added after.
2017-03-25 14:19:48 +01:00