Skip to content
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

test: added pretty_assertion and nextest #2

Merged
merged 2 commits into from
Jan 18, 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
4 changes: 4 additions & 0 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name = "flatcitybuf"
version = "0.1.0"
edition = "2021"

[workspace.lints.clippy]
absolute_path = "warn"
nursery = { level = "warn", priority = -1 }

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/rust/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pre-commit:
cargo fmt
cargo clippy --fix --allow-dirty
cargo machete
cargo test
cargo nextest run
cargo check --all-features
cargo build --release

Expand Down
11 changes: 11 additions & 0 deletions src/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,14 @@ fn main() -> Result<()> {
Commands::Info { input } => show_info(input),
}
}

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

#[test]
fn verify_cli() {
use clap::CommandFactory;
Cli::command().debug_assert();
}
}
1 change: 1 addition & 0 deletions src/rust/src/reader/geom_decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ mod tests {
},
serializer::to_geometry,
};
use pretty_assertions::assert_eq;

use super::*;
use anyhow::Result;
Expand Down
1 change: 1 addition & 0 deletions src/rust/src/writer/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ mod tests {
use super::*;

use anyhow::Result;
use pretty_assertions::assert_eq;
use serde_json::json;

#[test]
Expand Down
1 change: 1 addition & 0 deletions src/rust/src/writer/geom_encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ mod tests {
use super::*;
use anyhow::Result;
use cjseq::Geometry as CjGeometry;
use pretty_assertions::assert_eq;

use serde_json::json;

Expand Down
1 change: 1 addition & 0 deletions src/rust/src/writer/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ mod tests {
use anyhow::Result;
use cjseq::CityJSONFeature;
use flatbuffers::FlatBufferBuilder;
use pretty_assertions::assert_eq;

#[test]
fn test_to_fcb_city_feature() -> Result<()> {
Expand Down
1 change: 1 addition & 0 deletions src/rust/tests/e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use flatcitybuf::{
header_writer::HeaderWriterOptions,
read_cityjson_from_reader, CJType, CJTypeKind, FcbReader, FcbWriter,
};
use pretty_assertions::assert_eq;
use std::{
fs::File,
io::{BufReader, BufWriter},
Expand Down
Loading