Skip to content

fixed documentation #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
run: cargo test --lib --tests --verbose
6 changes: 4 additions & 2 deletions src/functionality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ pub mod user_cfg;
/// unless confirmed by the user.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires ../configs/zram-generator.conf and sudo privileges.
/// // Use integration tests for actual validation.
/// use gnulinwiz::functionality::zram::zram_swap_setup;
/// let result = zram_swap_setup();
/// assert_eq!(result, 0); // Successful ZRAM setup
/// assert_eq!(result, 0); // Success if config exists and no overwrite
/// ```
pub mod zram;
6 changes: 4 additions & 2 deletions src/functionality/configs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ use std::path::Path;
/// - The file copy operation fails due to permissions or other I/O errors.
///
/// # Example
/// ```
/// ```should_panic
/// // This example requires a valid ../configs/.zshrc file and write permissions.
/// // For actual testing, use integration tests with a mocked file system.
/// use gnulinwiz::functionality::configs::user_config_setup;
/// let result = user_config_setup("../configs/.zshrc", "/home/user", "zsh");
/// assert_eq!(result, 0); // Configuration copied or skipped successfully
/// assert_eq!(result, 0); // Success if files exist and no overwrite prompt
/// ```
///
/// # See Also
Expand Down
5 changes: 3 additions & 2 deletions src/functionality/iptables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ use std::fs;
/// - Writing to `/etc/iptables/iptables.rules` fails due to permissions or `sudo` issues.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires ../configs/iptables.rules and sudo privileges.
/// use gnulinwiz::functionality::iptables::iptables_file_setup;
/// let result = iptables_file_setup();
/// assert_eq!(result, 0); // Rules file created or skipped successfully
/// assert_eq!(result, 0);
/// ```
///
/// # See Also
Expand Down
13 changes: 8 additions & 5 deletions src/functionality/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ pub fn change_def_shell(name: &str) -> i8 {
/// - The `bash` command fails to execute the script or returns a non-zero exit status.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires network access and curl/bash.
/// use gnulinwiz::functionality::shell::install_omz;
/// let result = install_omz();
/// assert_eq!(result, 0); // Oh My Zsh installed or already present
/// assert_eq!(result, 0);
/// ```
///
/// # See Also
Expand Down Expand Up @@ -201,10 +202,11 @@ fn install_zsh_plugin(home_dir: &str, plugin_name: &str, repo_url: &str) -> i8 {
/// Returns `1` if the `git clone` command fails due to network issues, permissions, or invalid URLs.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires git and network access.
/// use gnulinwiz::functionality::shell::install_zsh_autosuggestions;
/// let result = install_zsh_autosuggestions("/home/user");
/// assert_eq!(result, 0); // Plugin installed or already present
/// assert_eq!(result, 0);
/// ```
///
/// # See Also
Expand Down Expand Up @@ -236,7 +238,8 @@ pub fn install_zsh_autosuggestions(home_dir: &str) -> i8 {
/// Returns `1` if the `git clone` command fails due to network issues, permissions, or invalid URLs.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires git and network access.
/// use gnulinwiz::functionality::shell::install_zsh_syntax_highlighting;
/// let result = install_zsh_syntax_highlighting("/home/user");
/// assert_eq!(result, 0); // Plugin installed or already present
Expand Down
8 changes: 5 additions & 3 deletions src/functionality/zram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ use colored::Colorize;
/// - The copy operation fails due to permissions or `sudo` issues.
///
/// # Example
/// ```
/// ```should_panic
/// // Requires ../configs/zram-generator.conf and sudo privileges.
/// // Use integration tests for actual validation.
/// use gnulinwiz::functionality::zram::zram_swap_setup;
/// let result = zram_swap_setup();
/// assert_eq!(result, 0); // ZRAM configured or skipped successfully
/// assert_eq!(result, 0); // Success if config exists and no overwrite
/// ```
///
///
/// # See Also
/// - `commands::run_sudo_command`: Used to copy the configuration file with `sudo`.
/// - `prog_fun::read_input`: Used to prompt for overwrite confirmation.
Expand Down