feat: remove test bin
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
207a6f5c44
commit
d37462941c
12
Cargo.lock
generated
12
Cargo.lock
generated
@ -551,7 +551,12 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
"bytes 0.4.12",
|
||||
"crunch-file",
|
||||
"crunch-traits",
|
||||
"prost 0.12.1",
|
||||
"prost-build",
|
||||
"prost-types 0.12.1",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
@ -1926,13 +1931,6 @@ dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "test-bin"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"crunch-envelope",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textwrap"
|
||||
version = "0.16.0"
|
||||
|
@ -25,6 +25,7 @@ toml_edit = {version = "0.20.0",features = ["serde"]}
|
||||
serde = {version = "1.0.88", features = ["derive"]}
|
||||
prost = {version = "0.12"}
|
||||
prost-types = {version = "0.12"}
|
||||
prost-build = "0.5"
|
||||
bytes = {version = "0.4"}
|
||||
|
||||
|
||||
|
@ -7,8 +7,13 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
crunch-traits.workspace = true
|
||||
crunch-file.workspace = true
|
||||
|
||||
anyhow.workspace = true
|
||||
tracing.workspace = true
|
||||
tokio.workspace = true
|
||||
async-trait.workspace = true
|
||||
prost.workspace = true
|
||||
prost-types.workspace = true
|
||||
prost-build.workspace = true
|
||||
bytes.workspace = true
|
||||
|
@ -1,14 +1,15 @@
|
||||
pub fn add(left: usize, right: usize) -> usize {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[tokio::test]
|
||||
async fn test_can_generate_output_rust() {
|
||||
let proto_spec = r#"
|
||||
syntax = "proto3";
|
||||
|
||||
#[test]
|
||||
fn it_works() {
|
||||
let result = add(2, 2);
|
||||
assert_eq!(result, 4);
|
||||
package test.can.generate.output.rust;
|
||||
|
||||
message MyEvent {
|
||||
string name = 1;
|
||||
}
|
||||
"#;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "test-bin"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
crunch-envelope.workspace = true
|
@ -1,27 +0,0 @@
|
||||
fn main() {
|
||||
#[no_mangle]
|
||||
fn envelope_capnp_benchmark(content: &[u8]) {
|
||||
let out = crunch_envelope::wrap("some-domain", "some-entity", content);
|
||||
|
||||
let out = crunch_envelope::unwrap(&out).expect("to be able to unwrap capnp message");
|
||||
|
||||
println!("{:?}", out.1);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
fn envelope_json_benchmark(content: &[u8]) {
|
||||
let out = crunch_envelope::json::wrap("some-domain", "some-entity", content);
|
||||
|
||||
let out = crunch_envelope::json::unwrap(&out).expect("to be able to unwrap capnp message");
|
||||
|
||||
println!("{:?}", out.1);
|
||||
}
|
||||
|
||||
let large_content: [u8; 1000000] = [0; 1000000];
|
||||
|
||||
envelope_capnp_benchmark(&large_content);
|
||||
|
||||
envelope_json_benchmark(&large_content);
|
||||
|
||||
println!("done")
|
||||
}
|
Loading…
Reference in New Issue
Block a user