Skip to content
Open
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
31 changes: 31 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Rust CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
13 changes: 13 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,16 @@ fn main() {
println!(" {:.1} {} of space taken by duplicates", val, suffix);
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_hash_file() {
let path = PathBuf::from("test_file.txt");
let (tx, _rx) = channel();
hash_file(false, 1024, path, tx); // This will fail if the file does not exist or cannot be read
}

}