Skip to content

Commit 3128679

Browse files
authored
Merge pull request #46 from octplane/task/test-pr
Try to break tests in CI
2 parents 43fc493 + e3488b9 commit 3128679

File tree

4 files changed

+44
-15
lines changed

4 files changed

+44
-15
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,3 @@ jobs:
4949

5050
- name: Check compilation
5151
run: cargo check --all-targets --all-features
52-
53-
- name: Run tests
54-
run: cargo test --all-features
55-

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,41 @@ In `cargo.toml`
1111
fsevent = "*"
1212
```
1313

14+
1415
# Usage
1516

1617
cf examples/ folder.
1718

19+
# Contributing
20+
21+
Contributions are welcome! Here's how you can help:
22+
23+
## Reporting Issues
24+
25+
If you find a bug or have a feature request, please open an issue on GitHub with:
26+
- A clear description of the problem or suggestion
27+
- Steps to reproduce (for bugs)
28+
- Expected vs actual behavior
29+
- Your environment details (OS version, Rust version)
30+
31+
## Pull Requests
32+
33+
1. Fork the repository
34+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
35+
3. Make your changes
36+
4. Run tests: `cargo test`
37+
5. Run clippy: `cargo clippy`
38+
6. Format your code: `cargo fmt`
39+
7. Commit your changes (`git commit -m 'Add some amazing feature'`)
40+
8. Push to your branch (`git push origin feature/amazing-feature`)
41+
9. Open a Pull Request
42+
43+
Please ensure:
44+
- All tests pass
45+
- Code follows Rust style guidelines (enforced by `rustfmt`)
46+
- New features include tests
47+
- Documentation is updated if needed
48+
1849
# Contributors
1950

2051
- Mathieu Poumeyrol [kali](https://github.com/kali)

examples/fsevent-async-demo.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ fn main() {
1818
let duration = std::time::Duration::from_secs(1);
1919
match receiver.recv_timeout(duration) {
2020
Ok(val) => println!("{:?}", val),
21-
Err(e) => match e {
22-
std::sync::mpsc::RecvTimeoutError::Disconnected => break,
23-
_ => {} // This is the case where nothing entered the channel buffer (no file mods).
24-
},
21+
// This is the case where nothing entered the channel buffer (no file mods).
22+
Err(e) => {
23+
if e == std::sync::mpsc::RecvTimeoutError::Disconnected {
24+
break;
25+
}
26+
}
2527
}
2628
}
2729

tests/fsevent.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,19 +229,16 @@ fn internal_validate_watch_single_file(run_async: bool) {
229229
let mut file = OpenOptions::new()
230230
.write(true)
231231
.create(true)
232+
.truncate(true)
232233
.open(dst.as_path())
233234
.unwrap();
234235
file.write_all(b"create").unwrap();
235236
file.flush().unwrap();
236237
drop(file);
237-
238+
238239
// Wait a bit then modify
239240
thread::sleep(Duration::from_millis(100));
240-
let mut file = OpenOptions::new()
241-
.write(true)
242-
.append(true)
243-
.open(dst.as_path())
244-
.unwrap();
241+
let mut file = OpenOptions::new().append(true).open(dst.as_path()).unwrap();
245242
file.write_all(b"foo").unwrap();
246243
file.flush().unwrap();
247244
});
@@ -252,7 +249,10 @@ fn internal_validate_watch_single_file(run_async: bool) {
252249
receiver,
253250
vec![(
254251
dst.to_str().unwrap().to_string(),
255-
StreamFlags::ITEM_MODIFIED | StreamFlags::ITEM_CREATED | StreamFlags::ITEM_XATTR_MOD | StreamFlags::IS_FILE,
252+
StreamFlags::ITEM_MODIFIED
253+
| StreamFlags::ITEM_CREATED
254+
| StreamFlags::ITEM_XATTR_MOD
255+
| StreamFlags::IS_FILE,
256256
)],
257257
);
258258

0 commit comments

Comments
 (0)