test(ariadne): cover pipeline prerequisites #41
@@ -1,4 +1,4 @@
|
||||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
|
||||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
|
||||
|
||||
rust_library(
|
||||
name = "ariadne_lib",
|
||||
@@ -19,3 +19,9 @@ rust_binary(
|
||||
],
|
||||
)
|
||||
|
||||
rust_test(
|
||||
name = "pipeline_test",
|
||||
srcs = ["pipeline_test.rs"],
|
||||
deps = [":ariadne_lib"],
|
||||
)
|
||||
|
||||
|
||||
22
src/ariadne/pipeline_test.rs
Normal file
22
src/ariadne/pipeline_test.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
use ariadne::pipeline::Stage;
|
||||
|
||||
#[test]
|
||||
fn with_prerequisites_orders_prerequisites_before_target() {
|
||||
assert_eq!(
|
||||
Stage::AddJumpEdges.with_prerequisites(),
|
||||
[Stage::Parse, Stage::AddJumpEdges]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn with_prerequisites_deduplicates_shared_prerequisites() {
|
||||
assert_eq!(
|
||||
Stage::All.with_prerequisites(),
|
||||
[
|
||||
Stage::Parse,
|
||||
Stage::AddImplicitEdges,
|
||||
Stage::AddInitEdges,
|
||||
Stage::AddJumpEdges,
|
||||
]
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user