Commit 9eb0ff8d authored by Kai Brandes's avatar Kai Brandes

react and wasm in integration

parent 308dcdf6
......@@ -19,7 +19,6 @@ wee_alloc = { version = "0.4.1", optional = true }
[lib]
name = "adventofcode_2017_lib"
path = "src/lib.rs"
crate-type = ["cdylib", "lib"]
......@@ -27,5 +26,5 @@ crate-type = ["cdylib", "lib"]
default-features = ["console_error_panic_hook", "wee_alloc"]
[[bin]]
name = "adventofcode_2017"
name = "adventofcode_2017_bin"
path = "src/bin.rs"
extern crate adventofcode_2017_lib;
extern crate adventofcode_2017;
fn main() {
println!("Welcome to my adventofcode-2017 solutions.");
println!("Solution for day 1a is: {}", adventofcode_2017_lib::results::day_1_a());
println!("Solution for day 1b is: {}", adventofcode_2017_lib::results::day_1_b());
println!("Solution for day 2a is: {}", adventofcode_2017_lib::results::day_2_a());
println!("Solution for day 2b is: {}", adventofcode_2017_lib::results::day_2_b());
println!("Solution for day 3a is: {}", adventofcode_2017_lib::results::day_3_a());
println!("Solution for day 3b is: {}", adventofcode_2017_lib::results::day_3_b());
println!("Solution for day 1a is: {}", adventofcode_2017::results::day_1_a());
println!("Solution for day 1b is: {}", adventofcode_2017::results::day_1_b());
println!("Solution for day 2a is: {}", adventofcode_2017::results::day_2_a());
println!("Solution for day 2b is: {}", adventofcode_2017::results::day_2_b());
println!("Solution for day 3a is: {}", adventofcode_2017::results::day_3_a());
println!("Solution for day 3b is: {}", adventofcode_2017::results::day_3_b());
}
\ No newline at end of file
......@@ -18,3 +18,9 @@ extern {
pub fn greet() {
alert("Hello, Advent!");
}
#[wasm_bindgen]
pub fn result_1a(input: String)-> u32 {
day1::calc_day_1_a(input)
}
extern crate adventofcode_2017_lib;
extern crate adventofcode_2017;
#[test]
fn it_shoul_assert_result_of_day1_a() {
assert_eq!(1031, adventofcode_2017_lib::results::day_1_a());
assert_eq!(1031, adventofcode_2017::results::day_1_a());
}
#[test]
fn it_shoul_assert_result_of_day1_b() {
assert_eq!(1080, adventofcode_2017_lib::results::day_1_b());
assert_eq!(1080, adventofcode_2017::results::day_1_b());
}
\ No newline at end of file
extern crate adventofcode_2017_lib;
extern crate adventofcode_2017;
#[test]
fn it_shoul_assert_result_of_day2_a() {
assert_eq!(34581, adventofcode_2017_lib::results::day_2_a());
assert_eq!(34581, adventofcode_2017::results::day_2_a());
}
#[test]
fn it_shoul_assert_result_of_day2_b() {
assert_eq!(214, adventofcode_2017_lib::results::day_2_b());
assert_eq!(214, adventofcode_2017::results::day_2_b());
}
\ No newline at end of file
extern crate adventofcode_2017_lib;
extern crate adventofcode_2017;
#[test]
fn it_shoul_assert_result_of_day3_a() {
assert_eq!(430, adventofcode_2017_lib::results::day_3_a());
assert_eq!(430, adventofcode_2017::results::day_3_a());
}
#[test]
fn it_shoul_assert_result_of_day3_b() {
assert_eq!(312453, adventofcode_2017_lib::results::day_3_b());
assert_eq!(312453, adventofcode_2017::results::day_3_b());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment