Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Tom <[email protected]>
  • Loading branch information
tdelmas committed Nov 5, 2023
1 parent 7b06be2 commit ae26268
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 10 deletions.
10 changes: 2 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ jobs:
- checkout
- run: rustup toolchain install nightly
- run: cargo +nightly -Zscript ./pre-publish.rs
- run:
command: cargo test --no-run
no_output_timeout: 15m
- run: cargo test
- run: cargo test --features serde
- run: cargo test --test 'serde' --features serde
build_and_test_arm:
machine:
image: ubuntu-2004:current
Expand All @@ -21,11 +18,8 @@ jobs:
- run: curl https://sh.rustup.rs -sSf | sh -s -- -y
- run: rustup toolchain install nightly
- run: cargo +nightly -Zscript ./pre-publish.rs
- run:
command: cargo test --no-run
no_output_timeout: 15m
- run: cargo test
- run: cargo test --features serde
- run: cargo test --test 'serde' --features serde

workflows:
version: 2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
cargo +nightly -Zscript ./pre-publish.rs
rustup toolchain install ${{ matrix.version }}
cargo build
- name: Build tests
run: cargo test --no-run
- name: Run tests
run: cargo test --verbose
- name: Run serde tests
run: cargo test --verbose --test 'serde' --features serde

clippy:
runs-on: ubuntu-latest
Expand Down
24 changes: 24 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions typed_floats/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ serde = { version = "1.0", features = ["derive"], optional = true }
# For examples
checked-float = "0.1.4"
ordered-float = "4.1.0"
serde_json = { version = "1.0" }
12 changes: 12 additions & 0 deletions typed_floats/tests/serde.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use typed_floats::*;


#[cfg(feature = "serde")]
#[test]
fn test_serde() {
let a: Positive<f64> = 3.0f64.try_into().unwrap();

let serialized = serde_json::to_string(&a).unwrap();

assert_eq!(serialized, "3.0");
}

0 comments on commit ae26268

Please sign in to comment.