Skip to content

Commit

Permalink
refactor: adapt test folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
open-schnick committed Dec 15, 2024
1 parent bc5db26 commit 300e8a6
Show file tree
Hide file tree
Showing 29 changed files with 47 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ default = []
pretty_assertions = "1.4.0"
regex = "1"

[lints.rust]
missing_docs = "deny"

[lints.rustdoc]
broken_intra_doc_links = "deny"
private_intra_doc_links = "deny"
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// cant be in Cargo.toml as the tests don't need docs
#![deny(missing_docs)]
//! Write smooth assertions in a fluent and human-readable way.
//!
//! 1. [Overview](#overview)
Expand Down
1 change: 1 addition & 0 deletions tests/smoothy/accessors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod to_string;
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/smoothy/equality.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mod equals;
mod is;
mod is_empty;
mod is_not;
mod not_equals;
mod try_equals;
mod try_not_equals;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions tests/smoothy/iter.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod indices;
mod size;

mod is_empty;
mod is_not_empty;
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/smoothy/iter/is_empty.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use smoothy::{assert_that, IteratorAssertion};

#[test]
fn succeeds() {
let vec: Vec<String> = vec![];
assert_that(vec).is_empty();
}

#[test]
#[should_panic = "assertion failed: `(Iterator is empty)`\n found: Some(\"\")"]
fn fails() {
let vec: Vec<String> = vec![String::default()];
assert_that(vec).is_empty();
}
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions tests/smoothy/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![allow(missing_docs)]

mod accessors;
mod boolean;
mod equality;
mod iter;
mod option;
mod result;
mod string;
2 changes: 2 additions & 0 deletions tests/smoothy/option.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod is_none;
mod is_some;
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/smoothy/result.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mod is_err;
mod is_ok;
3 changes: 1 addition & 2 deletions tests/is_err.rs → tests/smoothy/result/is_err.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::setup::{ComparableError, ConvertableError};
use crate::result::is_err::setup::{ComparableError, ConvertableError, NonComparableError};
use smoothy::{assert_that, EqualityAssertion, ResultAssertion};
use std::fmt::Display;

Expand Down Expand Up @@ -69,7 +69,6 @@ mod assert_error {

mod assert_error_as_string {
use super::*;
use crate::setup::NonComparableError;

#[test]
fn succeeds() {
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/smoothy/string.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod contains;
mod matches;
mod starts_with;
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 300e8a6

Please sign in to comment.