FD updates for chapter1

master
peshwar9 4 years ago
parent 13c7dc4081
commit 8eef60f788

BIN
chapter1/.DS_Store vendored

Binary file not shown.

@ -1,5 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "bench-test"
version = "0.1.0"

@ -1,9 +0,0 @@
[package]
name = "bench-test"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

@ -1,27 +0,0 @@
#![feature(test)]
extern crate test;
pub fn get_fact(n: u64) -> u64 {
if n < 2 {
1
} else {
n * get_fact(n - 1)
}
}
#[cfg(test)]
mod tests {
use super::*;
use test::Bencher;
#[test]
fn it_works() {
assert_eq!(120, get_fact(5));
}
#[bench]
fn bench_get_fact(b: &mut Bencher) {
b.iter(|| get_fact(1234571));
}
}

@ -1,3 +0,0 @@
fn main() {
println!("Hello, world!");
}

Binary file not shown.

@ -18,7 +18,7 @@ dependencies = [
]
[[package]]
name = "dep-example"
name = "deps-example"
version = "0.1.0"
dependencies = [
"chrono",

@ -1,7 +1,7 @@
[package]
name = "dep-example"
name = "deps-example"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
authors = ["peshwar9"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Binary file not shown.

@ -1,5 +0,0 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
[[package]]
name = "feature-test"
version = "0.1.0"

@ -1,16 +0,0 @@
[package]
name = "feature-test"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "featuretest"
path = "src/main.rs"
[features]
feature1 = []
[dependencies]

@ -1,19 +0,0 @@
#[cfg(feature = "feature1")]
pub use self::with_feature_config::execute;
#[cfg(not(feature = "feature1"))]
pub use self::without_feature_config::execute;
#[cfg(feature = "feature1")]
mod with_feature_config {
pub fn execute() {
println!("Executing feature 1");
}
}
#[cfg(not(feature = "feature1"))]
mod without_feature_config {
pub fn execute() {
println!("Not executing feature 1")
}
}

@ -1,5 +0,0 @@
use feature_test::execute;
fn main() {
execute();
}

@ -1,7 +1,7 @@
[package]
name = "first-program"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
authors = ["peshwar9"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -1,7 +1,7 @@
[package]
name = "integ-test-example"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
authors = ["peshwar9"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -31,7 +31,7 @@
<span class="kw">use</span> <span class="ident">integ_test_example</span>;
<span class="kw">fn</span> <span class="ident">get_id</span>() <span class="op">-</span><span class="op">&gt;</span> <span class="ident">i32</span> {
<span class="kw">fn</span> <span class="ident">get_id</span>() {
<span class="kw">let</span> <span class="ident">my_pid</span> <span class="op">=</span> <span class="ident">get_process_id</span>();
<span class="macro">println</span><span class="macro">!</span>(<span class="string">&quot;Process id for current process is: {}&quot;</span>, <span class="ident">my_pid</span>);
}

@ -1,7 +1,7 @@
[package]
name = "my-first-lib"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
authors = ["peshwar9"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -1,7 +1,7 @@
[package]
name = "test-example"
version = "0.1.0"
authors = ["peshwar9 <par.esh1937@gmail.com>"]
authors = ["peshwar9"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

@ -0,0 +1 @@
{"rustc_fingerprint":4503571881771466578,"outputs":{"1164083562126845933":["rustc 1.43.0 (4fb7144ed 2020-04-20)\nbinary: rustc\ncommit-hash: 4fb7144ed159f94491249e86d5bbd033b5d60550\ncommit-date: 2020-04-20\nhost: x86_64-apple-darwin\nrelease: 1.43.0\nLLVM version: 9.0\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/prabhueshwarla/.rustup/toolchains/stable-x86_64-apple-darwin\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n",""]},"successes":{}}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":16120433538194145899,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/test-example-1aff5c91933770bc/dep-bin-test_example-1aff5c91933770bc"}}],"rustflags":[],"metadata":13779719443416291531}

@ -0,0 +1 @@
{"rustc":12217307662193597186,"features":"[]","target":16120433538194145899,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/test-example-b4dba4d825305f9f/dep-test-bin-test_example-b4dba4d825305f9f"}}],"rustflags":[],"metadata":13779719443416291531}

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/code/prod/chapter1/test-example/target/rls/debug/deps/test_example-1aff5c91933770bc.rmeta: src/main.rs
/Users/prabhueshwarla/rust/author/packt/code/prod/chapter1/test-example/target/rls/debug/deps/test_example-1aff5c91933770bc.d: src/main.rs
src/main.rs:

@ -0,0 +1,5 @@
/Users/prabhueshwarla/rust/author/packt/code/prod/chapter1/test-example/target/rls/debug/deps/test_example-b4dba4d825305f9f.rmeta: src/main.rs
/Users/prabhueshwarla/rust/author/packt/code/prod/chapter1/test-example/target/rls/debug/deps/test_example-b4dba4d825305f9f.d: src/main.rs
src/main.rs:

@ -1,7 +0,0 @@
use my-process-lib;
#[test]
fn test_if_process_id_is_returned() {
assert_eq!(get_process_id(), 0, "There is error in code");
println!("Hello from integration test")
}
Loading…
Cancel
Save