-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c792d5e
commit 836c6e3
Showing
7 changed files
with
62 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use rust_template_output::hello; | ||
|
||
fn main() { | ||
println!("{} (from bin_1)", hello()); | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn test_bin_1_one() { | ||
let foo = "foo"; | ||
assert!(!foo.is_empty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/// Returns hello string | ||
/// | ||
/// ``` | ||
/// use rust_template_output::hello; | ||
/// | ||
/// let foo = hello(); | ||
/// assert!(!foo.is_empty()); | ||
/// ``` | ||
pub fn hello() -> &'static str { | ||
"Hello, World!" | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
|
||
#[test] | ||
fn test_lib_one() { | ||
let foo = hello(); | ||
assert!(!foo.is_empty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,20 @@ | ||
use rust_template_output::hello; | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
println!("{}", hello()); | ||
|
||
if cfg!(feature = "test_feature_1") { | ||
println!("test-feature-1 is enabled"); | ||
} else { | ||
println!("test-feature-1 is disabled"); | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn test_main_one() { | ||
let foo = "foo"; | ||
assert!(!foo.is_empty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use rust_template_output::hello; | ||
|
||
#[test] | ||
fn test_integration_one() { | ||
let foo = hello(); | ||
assert!(!foo.is_empty()); | ||
} |