1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

tests: add tests on default triggers

This commit is contained in:
Sébastien Helleu
2021-11-12 20:58:30 +01:00
parent f2ad57ceb9
commit d98940fecb
7 changed files with 727 additions and 213 deletions
+54 -53
View File
@@ -389,59 +389,60 @@ WeeChat "core" is located in following directories:
[width="100%",cols="2m,3",options="header"]
|===
| Path/file | Description
| tests/ | Root of tests.
|    tests.cpp | Program used to run all tests.
|    scripts/ | Root of scripting API tests.
|       test-scripts.cpp | Program used to run the scripting API tests.
|       python/ | Python scripts to generate and run the scripting API tests.
|          testapigen.py | Python script generating scripts in all languages to test the scripting API.
|          testapi.py | Python script with scripting API tests, used by script testapigen.py.
|          unparse.py | Convert Python code to other languages, used by script testapigen.py.
|    unit/ | Root of unit tests.
|       test-plugins.cpp | Tests: plugins.
|       core/ | Root of unit tests for core.
|          test-core-arraylist.cpp | Tests: arraylists.
|          test-core-calc.cpp | Tests: calculation of expressions.
|          test-core-config-file.cpp | Tests: configuration files.
|          test-core-crypto.cpp | Tests: cryptographic functions.
|          test-core-dir.cpp | Tests: directory/file functions.
|          test-core-eval.cpp | Tests: evaluation of expressions.
|          test-core-hashtble.cpp | Tests: hashtables.
|          test-core-hdata.cpp | Tests: hdata.
|          test-core-hook.cpp | Tests: hooks.
|          test-core-infolist.cpp | Tests: infolists.
|          test-core-list.cpp | Tests: lists.
|          test-core-network.cpp | Tests: network functions.
|          test-core-secure.cpp | Tests: secured data.
|          test-core-signal.cpp | Tests: signals.
|          test-core-string.cpp | Tests: strings.
|          test-core-url.cpp | Tests: URLs.
|          test-core-utf8.cpp | Tests: UTF-8.
|          test-core-util.cpp | Tests: utility functions.
|       gui/ | Root of unit tests for interfaces.
|          test-gui-color.cpp | Tests: colors.
|          test-gui-line.cpp | Tests: lines.
|          test-gui-nick.cpp | Tests: nicks.
|       plugins/ | Root of unit tests for plugins.
|          irc/ | Root of unit tests for IRC plugin.
|             test-irc-buffer.cpp | Tests: IRC buffers.
|             test-irc-channel.cpp | Tests: IRC channels.
|             test-irc-color.cpp | Tests: IRC colors.
|             test-irc-config.cpp | Tests: IRC configuration.
|             test-irc-ignore.cpp | Tests: IRC ignores.
|             test-irc-message.cpp | Tests: IRC messages.
|             test-irc-mode.cpp | Tests: IRC modes.
|             test-irc-nick.cpp | Tests: IRC nicks.
|             test-irc-protocol.cpp | Tests: IRC protocol.
|             test-irc-server.cpp | Tests: IRC server.
|          trigger/ | Root of unit tests for trigger plugin.
|             test-trigger.cpp | Tests: triggers.
|          typing/ | Root of unit tests for typing plugin.
|             test-typing.cpp | Tests: typing.
|             test-typing-status.cpp | Tests: typing status.
|          relay/ | Root of unit tests for Relay plugin.
|             test-relay-auth.cpp | Tests: clients authentication.
| Path/file | Description
| tests/ | Root of tests.
|    tests.cpp | Program used to run all tests.
|    scripts/ | Root of scripting API tests.
|       test-scripts.cpp | Program used to run the scripting API tests.
|       python/ | Python scripts to generate and run the scripting API tests.
|          testapigen.py | Python script generating scripts in all languages to test the scripting API.
|          testapi.py | Python script with scripting API tests, used by script testapigen.py.
|          unparse.py | Convert Python code to other languages, used by script testapigen.py.
|    unit/ | Root of unit tests.
|       test-plugins.cpp | Tests: plugins.
|       core/ | Root of unit tests for core.
|          test-core-arraylist.cpp | Tests: arraylists.
|          test-core-calc.cpp | Tests: calculation of expressions.
|          test-core-config-file.cpp | Tests: configuration files.
|          test-core-crypto.cpp | Tests: cryptographic functions.
|          test-core-dir.cpp | Tests: directory/file functions.
|          test-core-eval.cpp | Tests: evaluation of expressions.
|          test-core-hashtble.cpp | Tests: hashtables.
|          test-core-hdata.cpp | Tests: hdata.
|          test-core-hook.cpp | Tests: hooks.
|          test-core-infolist.cpp | Tests: infolists.
|          test-core-list.cpp | Tests: lists.
|          test-core-network.cpp | Tests: network functions.
|          test-core-secure.cpp | Tests: secured data.
|          test-core-signal.cpp | Tests: signals.
|          test-core-string.cpp | Tests: strings.
|          test-core-url.cpp | Tests: URLs.
|          test-core-utf8.cpp | Tests: UTF-8.
|          test-core-util.cpp | Tests: utility functions.
|       gui/ | Root of unit tests for interfaces.
|          test-gui-color.cpp | Tests: colors.
|          test-gui-line.cpp | Tests: lines.
|          test-gui-nick.cpp | Tests: nicks.
|       plugins/ | Root of unit tests for plugins.
|          irc/ | Root of unit tests for IRC plugin.
|             test-irc-buffer.cpp | Tests: IRC buffers.
|             test-irc-channel.cpp | Tests: IRC channels.
|             test-irc-color.cpp | Tests: IRC colors.
|             test-irc-config.cpp | Tests: IRC configuration.
|             test-irc-ignore.cpp | Tests: IRC ignores.
|             test-irc-message.cpp | Tests: IRC messages.
|             test-irc-mode.cpp | Tests: IRC modes.
|             test-irc-nick.cpp | Tests: IRC nicks.
|             test-irc-protocol.cpp | Tests: IRC protocol.
|             test-irc-server.cpp | Tests: IRC server.
|          trigger/ | Root of unit tests for trigger plugin.
|             test-trigger.cpp | Tests: triggers.
|             test-trigger-config.cpp | Tests: trigger configuration.
|          typing/ | Root of unit tests for typing plugin.
|             test-typing.cpp | Tests: typing.
|             test-typing-status.cpp | Tests: typing status.
|          relay/ | Root of unit tests for Relay plugin.
|             test-relay-auth.cpp | Tests: clients authentication.
|===
+54 -53
View File
@@ -391,59 +391,60 @@ Le cœur de WeeChat est situé dans les répertoires suivants :
[width="100%",cols="2m,3",options="header"]
|===
| Chemin/fichier | Description
| tests/ | Racine des tests.
|    tests.cpp | Programme utilisé pour lancer tous les tests.
|    scripts/ | Racine des tests de l'API script.
|       test-scripts.cpp | Programme utilisé pour lancer les tests de l'API script.
|       python/ | Scripts Python pour générer et lancer les tests de l'API script.
|          testapigen.py | Script Python générant des scripts dans tous les languages pour tester l'API script.
|          testapi.py | Script Python avec les tests API, utilisé par le script testapigen.py.
|          unparse.py | Conversion de code Python vers d'autres langages, utilisé par le script testapigen.py.
|    unit/ | Racine des tests unitaires.
|       test-plugins.cpp | Tests : extensions.
|       core/ | Racine des tests unitaires pour le cœur.
|          test-core-arraylist.cpp | Tests : listes avec tableau (« arraylists »).
|          test-core-calc.cpp | Tests : calcul d'expressions.
|          test-core-config-file.cpp | Tests : fichiers de configuration.
|          test-core-crypto.cpp | Tests : fonctions cryptographiques.
|          test-core-dir.cpp | Tests : répertoires/fichiers.
|          test-core-eval.cpp | Tests : évaluation d'expressions.
|          test-core-hashtble.cpp | Tests : tables de hachage.
|          test-core-hdata.cpp | Tests : hdata.
|          test-core-hook.cpp | Tests : hooks.
|          test-core-infolist.cpp | Tests : infolists.
|          test-core-list.cpp | Tests : listes.
|          test-core-network.cpp | Tests : fonctions réseau.
|          test-core-secure.cpp | Tests : données sécurisées.
|          test-core-signal.cpp | Tests : signaux.
|          test-core-string.cpp | Tests : chaînes.
|          test-core-url.cpp | Tests : URLs.
|          test-core-utf8.cpp | Tests : UTF-8.
|          test-core-util.cpp | Tests : fonctions utiles.
|       gui/ | Racine des tests unitaires pour les interfaces.
|          test-gui-color.cpp | Tests : couleurs.
|          test-gui-line.cpp | Tests : lignes.
|          test-gui-nick.cpp | Tests : pseudos.
|       plugins/ | Racine des tests unitaires pour les extensions.
|          irc/ | Racine des tests unitaires pour l'extension IRC.
|             test-irc-buffer.cpp | Tests : tampons IRC.
|             test-irc-channel.cpp | Tests : canaux IRC.
|             test-irc-color.cpp | Tests : couleurs IRC.
|             test-irc-config.cpp | Tests : configuration IRC.
|             test-irc-ignore.cpp | Tests : ignores IRC.
|             test-irc-message.cpp | Tests : messages IRC.
|             test-irc-mode.cpp | Tests : modes IRC.
|             test-irc-nick.cpp | Tests : pseudos IRC.
|             test-irc-protocol.cpp | Tests : protocole IRC.
|             test-irc-server.cpp | Tests : serveur IRC.
|          trigger/ | Racine des tests unitaires pour l'extension trigger.
|             test-trigger.cpp | Tests : triggers.
|          typing/ | Racine des tests unitaires pour l'extension typing.
|             test-typing.cpp | Tests : typing.
|             test-typing-status.cpp | Tests : statut d'écriture.
|          relay/ | Racine des tests unitaires pour l'extension Relay.
|             test-relay-auth.cpp | Tests : authentification des clients.
| Chemin/fichier | Description
| tests/ | Racine des tests.
|    tests.cpp | Programme utilisé pour lancer tous les tests.
|    scripts/ | Racine des tests de l'API script.
|       test-scripts.cpp | Programme utilisé pour lancer les tests de l'API script.
|       python/ | Scripts Python pour générer et lancer les tests de l'API script.
|          testapigen.py | Script Python générant des scripts dans tous les languages pour tester l'API script.
|          testapi.py | Script Python avec les tests API, utilisé par le script testapigen.py.
|          unparse.py | Conversion de code Python vers d'autres langages, utilisé par le script testapigen.py.
|    unit/ | Racine des tests unitaires.
|       test-plugins.cpp | Tests : extensions.
|       core/ | Racine des tests unitaires pour le cœur.
|          test-core-arraylist.cpp | Tests : listes avec tableau (« arraylists »).
|          test-core-calc.cpp | Tests : calcul d'expressions.
|          test-core-config-file.cpp | Tests : fichiers de configuration.
|          test-core-crypto.cpp | Tests : fonctions cryptographiques.
|          test-core-dir.cpp | Tests : répertoires/fichiers.
|          test-core-eval.cpp | Tests : évaluation d'expressions.
|          test-core-hashtble.cpp | Tests : tables de hachage.
|          test-core-hdata.cpp | Tests : hdata.
|          test-core-hook.cpp | Tests : hooks.
|          test-core-infolist.cpp | Tests : infolists.
|          test-core-list.cpp | Tests : listes.
|          test-core-network.cpp | Tests : fonctions réseau.
|          test-core-secure.cpp | Tests : données sécurisées.
|          test-core-signal.cpp | Tests : signaux.
|          test-core-string.cpp | Tests : chaînes.
|          test-core-url.cpp | Tests : URLs.
|          test-core-utf8.cpp | Tests : UTF-8.
|          test-core-util.cpp | Tests : fonctions utiles.
|       gui/ | Racine des tests unitaires pour les interfaces.
|          test-gui-color.cpp | Tests : couleurs.
|          test-gui-line.cpp | Tests : lignes.
|          test-gui-nick.cpp | Tests : pseudos.
|       plugins/ | Racine des tests unitaires pour les extensions.
|          irc/ | Racine des tests unitaires pour l'extension IRC.
|             test-irc-buffer.cpp | Tests : tampons IRC.
|             test-irc-channel.cpp | Tests : canaux IRC.
|             test-irc-color.cpp | Tests : couleurs IRC.
|             test-irc-config.cpp | Tests : configuration IRC.
|             test-irc-ignore.cpp | Tests : ignores IRC.
|             test-irc-message.cpp | Tests : messages IRC.
|             test-irc-mode.cpp | Tests : modes IRC.
|             test-irc-nick.cpp | Tests : pseudos IRC.
|             test-irc-protocol.cpp | Tests : protocole IRC.
|             test-irc-server.cpp | Tests : serveur IRC.
|          trigger/ | Racine des tests unitaires pour l'extension trigger.
|             test-trigger.cpp | Tests : triggers.
|             test-trigger-config.cpp | Tests : configuration trigger.
|          typing/ | Racine des tests unitaires pour l'extension typing.
|             test-typing.cpp | Tests : typing.
|             test-typing-status.cpp | Tests : statut d'écriture.
|          relay/ | Racine des tests unitaires pour l'extension Relay.
|             test-relay-auth.cpp | Tests : authentification des clients.
|===
[[documentation_translations]]
+55 -53
View File
@@ -408,81 +408,83 @@ WeeChat "core" は以下のディレクトリに配置されています:
[width="100%",cols="2m,3",options="header"]
|===
| パス/ファイル名 | 説明
| tests/ | テスト用のルートディレクトリ
|    tests.cpp | 全テストの実行時に使われるプログラム
|    scripts/ | スクリプト API テスト用のルートディレクトリ
|       test-scripts.cpp | スクリプト API テストの実行時に使われるプログラム
|       python/ | スクリプト API テストを生成、実行する Python スクリプト
|          testapigen.py | スクリプト API のテスト時にすべての言語に関するスクリプトを生成する Python スクリプト
|          testapi.py | スクリプト API テスト時に使われる Python スクリプト (スクリプト testapigen.py から使われます)
|          unparse.py | Python コードを別の言語に変換 (スクリプト testapigen.py から使われます)
|    unit/ | 単体テスト用のルートディレクトリ
|       test-plugins.cpp | テスト: プラグイン
|       core/ | core 向け単体テスト用のルートディレクトリ
|          test-core-arraylist.cpp | テスト: 配列リスト
| パス/ファイル名 | 説明
| tests/ | テスト用のルートディレクトリ
|    tests.cpp | 全テストの実行時に使われるプログラム
|    scripts/ | スクリプト API テスト用のルートディレクトリ
|       test-scripts.cpp | スクリプト API テストの実行時に使われるプログラム
|       python/ | スクリプト API テストを生成、実行する Python スクリプト
|          testapigen.py | スクリプト API のテスト時にすべての言語に関するスクリプトを生成する Python スクリプト
|          testapi.py | スクリプト API テスト時に使われる Python スクリプト (スクリプト testapigen.py から使われます)
|          unparse.py | Python コードを別の言語に変換 (スクリプト testapigen.py から使われます)
|    unit/ | 単体テスト用のルートディレクトリ
|       test-plugins.cpp | テスト: プラグイン
|       core/ | core 向け単体テスト用のルートディレクトリ
|          test-core-arraylist.cpp | テスト: 配列リスト
// TRANSLATION MISSING
|          test-core-calc.cpp | Tests: calculation of expressions.
|          test-core-calc.cpp | Tests: calculation of expressions.
// TRANSLATION MISSING
|          test-core-config-file.cpp | Tests: configuration files.
|          test-core-config-file.cpp | Tests: configuration files.
// TRANSLATION MISSING
|          test-core-crypto.cpp | Tests: cryptographic functions.
|          test-core-crypto.cpp | Tests: cryptographic functions.
// TRANSLATION MISSING
|          test-core-dir.cpp | Tests: directory/file functions.
|          test-core-eval.cpp | テスト: 式の評価
|          test-core-hashtble.cpp | テスト: ハッシュテーブル
|          test-core-hdata.cpp | テスト: hdata
|          test-core-hook.cpp | テスト: フック
|          test-core-infolist.cpp | テスト: インフォリスト
|          test-core-list.cpp | テスト: リスト
|          test-core-dir.cpp | Tests: directory/file functions.
|          test-core-eval.cpp | テスト: 式の評価
|          test-core-hashtble.cpp | テスト: ハッシュテーブル
|          test-core-hdata.cpp | テスト: hdata
|          test-core-hook.cpp | テスト: フック
|          test-core-infolist.cpp | テスト: インフォリスト
|          test-core-list.cpp | テスト: リスト
// TRANSLATION MISSING
|          test-core-network.cpp | Tests: network functions.
|          test-core-secure.cpp | テスト: データ保護
|          test-core-network.cpp | Tests: network functions.
|          test-core-secure.cpp | テスト: データ保護
// TRANSLATION MISSING
|          test-core-signal.cpp | テスト: signals.
|          test-core-string.cpp | テスト: 文字列
|          test-core-url.cpp | テスト: URL
|          test-core-utf8.cpp | テスト: UTF-8
|          test-core-util.cpp | テスト: ユーティリティ関数
|       gui/ | インターフェースの単体テストを収める最上位ディレクトリ
|          test-core-signal.cpp | テスト: signals.
|          test-core-string.cpp | テスト: 文字列
|          test-core-url.cpp | テスト: URL
|          test-core-utf8.cpp | テスト: UTF-8
|          test-core-util.cpp | テスト: ユーティリティ関数
|       gui/ | インターフェースの単体テストを収める最上位ディレクトリ
// TRANSLATION MISSING
|          test-gui-color.cpp | Tests: colors.
|          test-gui-line.cpp | テスト: 行
|          test-gui-color.cpp | Tests: colors.
|          test-gui-line.cpp | テスト: 行
// TRANSLATION MISSING
|          test-gui-nick.cpp | テスト: nicks
|       plugins/ | プラグインの単体テストを収める最上位ディレクトリ
|          irc/ | IRC プラグインの単体テストを収める最上位ディレクトリ
|          test-gui-nick.cpp | テスト: nicks
|       plugins/ | プラグインの単体テストを収める最上位ディレクトリ
|          irc/ | IRC プラグインの単体テストを収める最上位ディレクトリ
// TRANSLATION MISSING
|             test-irc-buffer.cpp | Tests: IRC buffers.
|             test-irc-buffer.cpp | Tests: IRC buffers.
// TRANSLATION MISSING
|             test-irc-channel.cpp | Tests: IRC channels.
|             test-irc-color.cpp | Tests: IRC colors.
|             test-irc-config.cpp | テスト: IRC 設定
|             test-irc-channel.cpp | Tests: IRC channels.
|             test-irc-color.cpp | Tests: IRC colors.
|             test-irc-config.cpp | テスト: IRC 設定
// TRANSLATION MISSING
|             test-irc-ignore.cpp | Tests: IRC ignores.
|             test-irc-ignore.cpp | Tests: IRC ignores.
// TRANSLATION MISSING
|             test-irc-message.cpp | Tests: IRC messages.
|             test-irc-message.cpp | Tests: IRC messages.
// TRANSLATION MISSING
|             test-irc-mode.cpp | Tests: IRC modes.
|             test-irc-mode.cpp | Tests: IRC modes.
// TRANSLATION MISSING
|             test-irc-nick.cpp | Tests: IRC nicks.
|             test-irc-protocol.cpp | テスト: IRC プロトコル
|             test-irc-nick.cpp | Tests: IRC nicks.
|             test-irc-protocol.cpp | テスト: IRC プロトコル
// TRANSLATION MISSING
|             test-irc-server.cpp | Tests: IRC server.
|             test-irc-server.cpp | Tests: IRC server.
// TRANSLATION MISSING
|          trigger/ | Root of unit tests for trigger plugin.
|          trigger/ | Root of unit tests for trigger plugin.
// TRANSLATION MISSING
|             test-trigger.cpp | Tests: triggers.
|             test-trigger.cpp | Tests: triggers.
// TRANSLATION MISSING
|          typing/ | Root of unit tests for typing plugin.
|             test-trigger-config.cpp | Tests: trigger configuration.
// TRANSLATION MISSING
|             test-typing.cpp | Tests: typing.
|          typing/ | Root of unit tests for typing plugin.
// TRANSLATION MISSING
|             test-typing-status.cpp | Tests: typing status.
|             test-typing.cpp | Tests: typing.
// TRANSLATION MISSING
|          relay/ | Root of unit tests for Relay plugin.
|             test-typing-status.cpp | Tests: typing status.
// TRANSLATION MISSING
|             test-relay-auth.cpp | Tests: clients authentication.
|          relay/ | Root of unit tests for Relay plugin.
// TRANSLATION MISSING
|             test-relay-auth.cpp | Tests: clients authentication.
|===
[[documentation_translations]]
+55 -53
View File
@@ -389,61 +389,63 @@ WeeChat „језгро” се налази у следећим директо
[width="100%", cols="2m,3", options="header"]
|===
| Путања/фајл | Опис
| tests/ | Корен тестова.
|    tests.cpp | Програм који се користи за извршавање свих тестова.
|    scripts/ | Корен тестова за API скриптовања.
|       test-scripts.cpp | Програм који се користи за извршавање тестова API скриптовања.
|       python/ | Python скрипте које генеришу и покрећу тестове API скриптовања.
|          testapigen.py | Python скрипта која генерише скрипте на свим језицима за тестирање API скриптовања.
|          testapi.py | Python скрипта са тестовима API скриптовања, користи је скрипта testapigen.py.
|          unparse.py | Конверзија Python кода у остале језике, користи је скрипта testapigen.py.
|    unit/ | Корен unit тестова.
|       test-plugins.cpp | Тестови: plugins.
|       core/ | Корен unit тестова језгра.
|          test-core-arraylist.cpp | Тестови: arraylists.
|          test-core-calc.cpp | Тестови: калкулација израза.
| Путања/фајл | Опис
| tests/ | Корен тестова.
|    tests.cpp | Програм који се користи за извршавање свих тестова.
|    scripts/ | Корен тестова за API скриптовања.
|       test-scripts.cpp | Програм који се користи за извршавање тестова API скриптовања.
|       python/ | Python скрипте које генеришу и покрећу тестове API скриптовања.
|          testapigen.py | Python скрипта која генерише скрипте на свим језицима за тестирање API скриптовања.
|          testapi.py | Python скрипта са тестовима API скриптовања, користи је скрипта testapigen.py.
|          unparse.py | Конверзија Python кода у остале језике, користи је скрипта testapigen.py.
|    unit/ | Корен unit тестова.
|       test-plugins.cpp | Тестови: plugins.
|       core/ | Корен unit тестова језгра.
|          test-core-arraylist.cpp | Тестови: arraylists.
|          test-core-calc.cpp | Тестови: калкулација израза.
// TRANSLATION MISSING
|          test-core-config-file.cpp | Tests: configuration files.
|          test-core-crypto.cpp | Тестови: криптографске функције.
|          test-core-dir.cpp | Тестови: функције директоријума/фајла.
|          test-core-eval.cpp | Тестови: израчунавање израза.
|          test-core-hashtble.cpp | Тестови: hashtables.
|          test-core-hdata.cpp | Тестови: hdata.
|          test-core-hook.cpp | Тестови: куке.
|          test-core-infolist.cpp | Тестови: infolists.
|          test-core-list.cpp | Тестови: листе.
|          test-core-network.cpp | Тестови: мрежне функције.
|          test-core-secure.cpp | Тестови: обезбеђени подаци.
|          test-core-signal.cpp | Тестови: сигнали.
|          test-core-string.cpp | Тестови: стрингови.
|          test-core-url.cpp | Тестови: URL адресе.
|          test-core-utf8.cpp | Тестови: UTF-8.
|          test-core-util.cpp | Тестови: помоћне функције.
|       gui/ | Корен unit тестова интерфејса.
|          test-gui-color.cpp | Тестови: боје.
|          test-gui-line.cpp | Тестови: линије.
|          test-gui-nick.cpp | Тестови: надимци.
|       plugins/ | Корен unit тестова додатака.
|          irc/ | Корен unit тестова IRC додатка.
|          test-core-config-file.cpp | Tests: configuration files.
|          test-core-crypto.cpp | Тестови: криптографске функције.
|          test-core-dir.cpp | Тестови: функције директоријума/фајла.
|          test-core-eval.cpp | Тестови: израчунавање израза.
|          test-core-hashtble.cpp | Тестови: hashtables.
|          test-core-hdata.cpp | Тестови: hdata.
|          test-core-hook.cpp | Тестови: куке.
|          test-core-infolist.cpp | Тестови: infolists.
|          test-core-list.cpp | Тестови: листе.
|          test-core-network.cpp | Тестови: мрежне функције.
|          test-core-secure.cpp | Тестови: обезбеђени подаци.
|          test-core-signal.cpp | Тестови: сигнали.
|          test-core-string.cpp | Тестови: стрингови.
|          test-core-url.cpp | Тестови: URL адресе.
|          test-core-utf8.cpp | Тестови: UTF-8.
|          test-core-util.cpp | Тестови: помоћне функције.
|       gui/ | Корен unit тестова интерфејса.
|          test-gui-color.cpp | Тестови: боје.
|          test-gui-line.cpp | Тестови: линије.
|          test-gui-nick.cpp | Тестови: надимци.
|       plugins/ | Корен unit тестова додатака.
|          irc/ | Корен unit тестова IRC додатка.
// TRANSLATION MISSING
|             test-irc-buffer.cpp | Tests: IRC buffers.
|             test-irc-channel.cpp | Тестови: IRC канали.
|             test-irc-color.cpp | Тестови: IRC боје.
|             test-irc-config.cpp | Тестови: IRC конфигурација.
|             test-irc-ignore.cpp | Тестови: IRC игнорисања.
|             test-irc-message.cpp | Тестови: IRC поруке.
|             test-irc-mode.cpp | Тестови: IRC режими.
|             test-irc-nick.cpp | Тестови: IRC надимци.
|             test-irc-protocol.cpp | Тестови: IRC протокол.
|             test-irc-server.cpp | Тестови: IRC сервер.
|          trigger/ | Корен unit тестова за окидач додатак.
|             test-trigger.cpp | Тестови: окидачи.
|          typing/ | Корен unit тестова за typing додатак.
|             test-typing.cpp | Тестови: typing.
|             test-typing-status.cpp | Тестови: typing статус.
|          relay/ | Корен unit тестова за Релеј додатак.
|             test-relay-auth.cpp | Тестови: аутентификација клијената.
|             test-irc-buffer.cpp | Tests: IRC buffers.
|             test-irc-channel.cpp | Тестови: IRC канали.
|             test-irc-color.cpp | Тестови: IRC боје.
|             test-irc-config.cpp | Тестови: IRC конфигурација.
|             test-irc-ignore.cpp | Тестови: IRC игнорисања.
|             test-irc-message.cpp | Тестови: IRC поруке.
|             test-irc-mode.cpp | Тестови: IRC режими.
|             test-irc-nick.cpp | Тестови: IRC надимци.
|             test-irc-protocol.cpp | Тестови: IRC протокол.
|             test-irc-server.cpp | Тестови: IRC сервер.
|          trigger/ | Корен unit тестова за окидач додатак.
|             test-trigger.cpp | Тестови: окидачи.
// TRANSLATION MISSING
|             test-trigger-config.cpp | Tests: trigger configuration.
|          typing/ | Корен unit тестова за typing додатак.
|             test-typing.cpp | Тестови: typing.
|             test-typing-status.cpp | Тестови: typing статус.
|          relay/ | Корен unit тестова за Релеј додатак.
|             test-relay-auth.cpp | Тестови: аутентификација клијената.
|===
+1
View File
@@ -77,6 +77,7 @@ endif()
if(ENABLE_TRIGGER)
list(APPEND LIB_WEECHAT_UNIT_TESTS_PLUGINS_SRC
unit/plugins/trigger/test-trigger.cpp
unit/plugins/trigger/test-trigger-config.cpp
)
endif()
+2 -1
View File
@@ -87,7 +87,8 @@ tests_relay = unit/plugins/relay/test-relay-auth.cpp
endif
if PLUGIN_TRIGGER
tests_trigger = unit/plugins/trigger/test-trigger.cpp
tests_trigger = unit/plugins/trigger/test-trigger.cpp \
unit/plugins/trigger/test-trigger-config.cpp
endif
if PLUGIN_TYPING
@@ -0,0 +1,506 @@
/*
* test-trigger-config.cpp - test trigger configuration functions
*
* Copyright (C) 2021 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
#include "CppUTest/TestHarness.h"
extern "C"
{
#include <stdio.h>
#include "src/core/wee-hook.h"
#include "src/plugins/trigger/trigger.h"
}
#include "tests/tests.h"
#define WEE_CHECK_MODIFIER(__result, __modifier, __string) \
WEE_TEST_STR( \
__result, \
hook_modifier_exec (NULL, __modifier, NULL, __string));
#define WEE_CHECK_MODIFIER_INPUT(__result, __string) \
WEE_CHECK_MODIFIER(__result, "input_text_display", __string)
#define WEE_CHECK_MODIFIER_MSG_AUTH(__result, __string) \
WEE_CHECK_MODIFIER(__result, "irc_message_auth", __string)
TEST_GROUP(TriggerConfig)
{
};
/*
* Tests default trigger "beep".
*/
TEST(TriggerConfig, DefaultTriggerBeep)
{
/* TODO: write tests */
}
/*
* Tests default trigger "cmd_pass".
*/
TEST(TriggerConfig, DefaultTriggerCmdPass)
{
char *str;
/*
* /msg nickserv id <nick> <password>
* /msg nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/msg nickserv id",
"/msg nickserv id");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv id ************",
"/msg nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv id ******",
"/msg nickserv id secret");
/*
* /m nickserv id <nick> <password>
* /m nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/m nickserv id",
"/m nickserv id");
WEE_CHECK_MODIFIER_INPUT("/m nickserv id ************",
"/m nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/m nickserv id ******",
"/m nickserv id secret");
/*
* /quote nickserv id <nick> <password>
* /quote nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/quote nickserv id",
"/quote nickserv id");
WEE_CHECK_MODIFIER_INPUT("/quote nickserv id ************",
"/quote nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/quote nickserv id ******",
"/quote nickserv id secret");
/*
* /msg -server xxx nickserv id <nick> <password>
* /msg -server xxx nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/msg -server libera nickserv id",
"/msg -server libera nickserv id");
WEE_CHECK_MODIFIER_INPUT("/msg -server libera nickserv id ************",
"/msg -server libera nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/msg -server libera nickserv id ******",
"/msg -server libera nickserv id secret");
/*
* /m -server xxx nickserv id <nick> <password>
* /m -server xxx nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/m -server libera nickserv id",
"/m -server libera nickserv id");
WEE_CHECK_MODIFIER_INPUT("/m -server libera nickserv id ************",
"/m -server libera nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/m -server libera nickserv id ******",
"/m -server libera nickserv id secret");
/*
* /quote -server xxx nickserv id <nick> <password>
* /quote -server xxx nickserv id <password>
*/
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv id",
"/quote -server libera nickserv id");
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv id ************",
"/quote -server libera nickserv id alice secret");
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv id ******",
"/quote -server libera nickserv id secret");
/*
* /msg nickserv identify <nick> <password>
* /msg nickserv identify <password>
*/
WEE_CHECK_MODIFIER_INPUT("/msg nickserv identify",
"/msg nickserv identify");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv identify ************",
"/msg nickserv identify alice secret");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv identify ******",
"/msg nickserv identify secret");
/* /msg nickserv set password <password> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv set password",
"/msg nickserv set password");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv set password ******",
"/msg nickserv set password secret");
/* /msg nickserv ghost <nick> <password> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv ghost alice",
"/msg nickserv ghost alice");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv ghost alice ******",
"/msg nickserv ghost alice secret");
/* /msg nickserv release <nick> <password> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv release alice",
"/msg nickserv release alice");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv release alice ******",
"/msg nickserv release alice secret");
/* /msg nickserv regain <nick> <password> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv regain alice",
"/msg nickserv regain alice");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv regain alice ******",
"/msg nickserv regain alice secret");
/* /msg nickserv recover <nick> <password> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv recover alice",
"/msg nickserv recover alice");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv recover alice ******",
"/msg nickserv recover alice secret");
/* /oper <nick> <password> */
WEE_CHECK_MODIFIER_INPUT("/oper alice",
"/oper alice");
WEE_CHECK_MODIFIER_INPUT("/oper alice ******",
"/oper alice secret");
/* /quote pass <password> */
WEE_CHECK_MODIFIER_INPUT("/quote pass",
"/quote pass");
WEE_CHECK_MODIFIER_INPUT("/quote pass ******",
"/quote pass secret");
/* /secure passphrase <pasphrase> */
WEE_CHECK_MODIFIER_INPUT("/secure passphrase",
"/secure passphrase");
WEE_CHECK_MODIFIER_INPUT("/secure passphrase **********************",
"/secure passphrase this is the passphrase");
/* /secure decrypt <pasphrase> */
WEE_CHECK_MODIFIER_INPUT("/secure decrypt",
"/secure decrypt");
WEE_CHECK_MODIFIER_INPUT("/secure decrypt **********************",
"/secure decrypt this is the passphrase");
/* /secure set <name> <value> */
WEE_CHECK_MODIFIER_INPUT("/secure set name",
"/secure set name");
WEE_CHECK_MODIFIER_INPUT("/secure set name ******",
"/secure set name secret");
/* modifier "history_add" */
WEE_CHECK_MODIFIER("/msg nickserv identify ************",
"history_add",
"/msg nickserv identify alice secret");
/* modifier "irc_command_auth" */
WEE_CHECK_MODIFIER("/msg nickserv identify ************",
"irc_command_auth",
"/msg nickserv identify alice secret");
}
/*
* Tests default trigger "cmd_pass_register".
*/
TEST(TriggerConfig, DefaultTriggerCmdPassRegister)
{
char *str;
/* /msg nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/msg nickserv register",
"/msg nickserv register");
WEE_CHECK_MODIFIER_INPUT("/msg nickserv register ****** test@example.com",
"/msg nickserv register secret test@example.com");
/* /m nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/m nickserv register",
"/m nickserv register");
WEE_CHECK_MODIFIER_INPUT("/m nickserv register ****** test@example.com",
"/m nickserv register secret test@example.com");
/* /quote nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/quote nickserv register",
"/quote nickserv register");
WEE_CHECK_MODIFIER_INPUT("/quote nickserv register ****** test@example.com",
"/quote nickserv register secret test@example.com");
/* /msg -server ccc nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv register",
"/quote -server libera nickserv register");
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv register ****** test@example.com",
"/quote -server libera nickserv register secret test@example.com");
/* /m -server ccc nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/m -server libera nickserv register",
"/m -server libera nickserv register");
WEE_CHECK_MODIFIER_INPUT("/m -server libera nickserv register ****** test@example.com",
"/m -server libera nickserv register secret test@example.com");
/* /quote -server ccc nickserv register <password> <email> */
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv register",
"/quote -server libera nickserv register");
WEE_CHECK_MODIFIER_INPUT("/quote -server libera nickserv register ****** test@example.com",
"/quote -server libera nickserv register secret test@example.com");
/* modifier "history_add" */
WEE_CHECK_MODIFIER("/msg nickserv register ****** test@example.com",
"history_add",
"/msg nickserv register secret test@example.com");
/* modifier "irc_command_auth" */
WEE_CHECK_MODIFIER("/msg nickserv register ****** test@example.com",
"irc_command_auth",
"/msg nickserv register secret test@example.com");
}
/*
* Tests default trigger "msg_auth".
*/
TEST(TriggerConfig, DefaultTriggerMsgAuth)
{
char *str;
/* id <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("id", "id");
WEE_CHECK_MODIFIER_MSG_AUTH("id ******", "id secret");
/* identify <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("identify", "identify");
WEE_CHECK_MODIFIER_MSG_AUTH("identify ******", "identify secret");
/* set password <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("set password", "set password");
WEE_CHECK_MODIFIER_MSG_AUTH("set password ******", "set password secret");
/* register <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("register", "register");
WEE_CHECK_MODIFIER_MSG_AUTH("register ******", "register secret");
/* ghost <nick> <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("ghost alice", "ghost alice");
WEE_CHECK_MODIFIER_MSG_AUTH("ghost alice ******", "ghost alice secret");
/* release <nick> <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("release alice", "release alice");
WEE_CHECK_MODIFIER_MSG_AUTH("release alice ******", "release alice secret");
/* regain <nick> <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("regain alice", "regain alice");
WEE_CHECK_MODIFIER_MSG_AUTH("regain alice ******", "regain alice secret");
/* recover <nick> <password> */
WEE_CHECK_MODIFIER_MSG_AUTH("recover alice", "recover alice");
WEE_CHECK_MODIFIER_MSG_AUTH("recover alice ******", "recover alice secret");
}
/*
* Tests default trigger "server_pass".
*/
TEST(TriggerConfig, DefaultTriggerServerPass)
{
char *str;
/*
* /server add <name> -password=xxx
* /server add <name> -sasl_password=xxx
*/
WEE_CHECK_MODIFIER_INPUT(
"/server add libera irc.libera.chat",
"/server add libera irc.libera.chat");
WEE_CHECK_MODIFIER_INPUT(
"/server add libera irc.libera.chat -password=******",
"/server add libera irc.libera.chat -password=secret");
WEE_CHECK_MODIFIER_INPUT(
"/server add libera irc.libera.chat -sasl_password=******",
"/server add libera irc.libera.chat -sasl_password=secret");
/*
* /connect <address> -password=xxx
* /connect <address> -sasl_password=xxx
*/
WEE_CHECK_MODIFIER_INPUT(
"/connect irc.libera.chat",
"/connect irc.libera.chat");
WEE_CHECK_MODIFIER_INPUT(
"/connect irc.libera.chat -password=******",
"/connect irc.libera.chat -password=secret");
WEE_CHECK_MODIFIER_INPUT(
"/connect irc.libera.chat -sasl_password=******",
"/connect irc.libera.chat -sasl_password=secret");
}
/*
* Tests functions:
* trigger_config_change_enabled
*/
TEST(TriggerConfig, ChangeEnabled)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_change_trigger_enabled
*/
TEST(TriggerConfig, ChangeTriggerEnabled)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_change_trigger_hook
*/
TEST(TriggerConfig, ChangeTriggerHook)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_change_trigger_arguments
*/
TEST(TriggerConfig, ChangeTriggerArguments)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_change_trigger_regex
*/
TEST(TriggerConfig, ChangeTriggerRegex)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_change_trigger_command
*/
TEST(TriggerConfig, ChangeTriggerCommand)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_create_trigger_option
*/
TEST(TriggerConfig, ChangeTriggerOption)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_create_option_temp
*/
TEST(TriggerConfig, CreateOptionTemp)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_use_temp_triggers
*/
TEST(TriggerConfig, UseTempTriggers)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_trigger_read_cb
*/
TEST(TriggerConfig, TriggerReadCb)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_trigger_write_default_cb
*/
TEST(TriggerConfig, TriggerWriteDefaultCb)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_reload_cb
*/
TEST(TriggerConfig, ReloadCb)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_init
*/
TEST(TriggerConfig, Init)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_read
*/
TEST(TriggerConfig, Read)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_write
*/
TEST(TriggerConfig, Write)
{
/* TODO: write tests */
}
/*
* Tests functions:
* trigger_config_free
*/
TEST(TriggerConfig, Free)
{
/* TODO: write tests */
}