Repository: osa1/tiny (language: rust)

Issue:
Test failure with `--features=desktop-notifications`
Originally reported in https://github.com/NixOS/nixpkgs/pull/243860/files#r1266384829.

```
$ cargo test --features=desktop-notifications
...
---- tests::config::parsing_tab_configs stdout ----
thread 'tests::config::parsing_tab_configs' panicked at 'assertion failed: `(left == right)`
  left: `Some(TabConfig { ignore: Some(true), notify: Some(Off) })`,
 right: `Some(TabConfig { ignore: Some(true), notify: Some(Mentions) })`', crates/libtiny_tui/src/tests/config.rs:70:5
stack backtrace:
   0: rust_begin_unwind
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
   1: core::panicking::panic_fmt
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
   2: core::panicking::assert_failed_inner
   3: core::panicking::assert_failed
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:228:5
   4: libtiny_tui::tests::config::parsing_tab_configs
             at ./src/tests/config.rs:70:5
   5: libtiny_tui::tests::config::parsing_tab_configs::{{closure}}
             at ./src/tests/config.rs:7:26
   6: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5
   7: core::ops::function::FnOnce::call_once
             at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```

We should start running tests with `desktop-notifications`. The other feature we have is about TLS, which we don't test, so there will be just one more test configuration.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 5e4bcb34..cfcbba11 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,14 +34,14 @@ jobs:
       - name: Build
         run: cargo build
 
-      - name: Run tests
+      - name: Test
         run: cargo test --all
 
       - name: Build examples and benches
         run: cargo build --examples --benches
 
   Linux_native_tls_notif:
-    name: '[Linux, native TLS + notifications] Build'
+    name: '[Linux, native TLS + notifications] Build and test'
     runs-on: ubuntu-20.04
     steps:
       - uses: actions/checkout@v2
@@ -57,14 +57,18 @@ jobs:
             toolchain: stable
             override: true
 
-      - name: Build with rustls and dbus
+      - name: Build
         run: |
-          cd crates/tiny
           cargo build --no-default-features \
             --features "tls-native desktop-notifications"
 
-  OSX_default:
-    name: '[OSX, default] Build and test'
+      - name: Test
+        run: |
+          cargo test --no-default-features \
+            --features "tls-native desktop-notifications"
+
+  macOS_default:
+    name: '[macOS, default] Build and test'
     runs-on: macos-latest
     steps:
       - uses: actions/checkout@v2
@@ -75,17 +79,17 @@ jobs:
             toolchain: stable
             override: true
 
-      - name: Build tiny
+      - name: Build
         run: cargo build
 
-      - name: Run tests
+      - name: Test
         run: cargo test
 
       - name: Build examples and benches
         run: cargo build --examples --benches
 
-  OSX_native_tls_notif:
-    name: '[OSX, native TLS + notifications] Build'
+  macOS_native_tls_notif:
+    name: '[macOS, native TLS + notifications] Build and test'
     runs-on: macos-latest
     steps:
       - uses: actions/checkout@v2
@@ -98,6 +102,10 @@ jobs:
 
       - name: Build
         run: |
-          cd crates/tiny
           cargo build --no-default-features \
             --features "tls-native desktop-notifications"
+
+      - name: Test
+        run: |
+          cargo test --no-default-features \
+            --features "tls-native desktop-notifications"


Test patch:
diff --git a/crates/libtiny_tui/src/tests/config.rs b/crates/libtiny_tui/src/tests/config.rs
index a93c0065..b9632892 100644
--- a/crates/libtiny_tui/src/tests/config.rs
+++ b/crates/libtiny_tui/src/tests/config.rs
@@ -70,8 +70,8 @@ fn parsing_tab_configs() {
     assert_eq!(
         tab_configs.get("server2", None),
         Some(TabConfig {
-            ignore: Some(true),                // configured
-            notify: Some(Notifier::default())  // overwritten by defaults
+            ignore: Some(true),          // configured
+            notify: Some(Notifier::Off)  // overwritten by defaults
         })
     );