Skip to content

Commit

Permalink
test(libmake): 🐛 fix tests and lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienrousseau committed Mar 15, 2024
1 parent 2d25256 commit 179fd7f
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 51 deletions.
2 changes: 1 addition & 1 deletion examples/generate_from_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ use libmake::generator::generate_from_args;
/// If successful, this program will print "Successfully generated files!".
///
/// If there is an error, it will print an error message.
pub fn main() {
pub(crate) fn main() {
// Simulate command line arguments
let args = "--author=Me --output=my_library"
.split(' ')
Expand Down
2 changes: 1 addition & 1 deletion examples/generate_from_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use libmake::generator::generate_from_config;
///
/// * `Ok(())` - If generation is successful.
/// * `Err(String)` - If there is an error during generation.
pub fn main() {
pub(crate) fn main() {
// Define the file path for the configuration file.
let file_path = "./tests/data/mylibrary.yaml";

Expand Down
2 changes: 1 addition & 1 deletion examples/generate_from_csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ use libmake::generator::generate_from_csv;
/// generate_from_csv(csv_file_path)
/// .expect("Failed to generate the template files");
/// ```
pub fn main() {
pub(crate) fn main() {
// Define the path to the CSV file to be used for testing.
let csv_file_path = "./tests/data/mylibrary.csv";

Expand Down
2 changes: 1 addition & 1 deletion examples/generate_from_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ use libmake::generator::generate_from_json;
///
/// * `Result<(), String>` - Returns `Ok(())` if the template files are generated successfully, or returns an error message if there is an error during generation.
///
pub fn main() {
pub(crate) fn main() {
// Define the path to the JSON file that contains configuration data.
let json_file_path = "./tests/data/mylibrary.json";

Expand Down
2 changes: 1 addition & 1 deletion examples/generate_from_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ use libmake::generator::generate_from_toml;
///
/// * `Result<(), String>` - Returns `Ok(())` if the template files are generated successfully, or returns an error message if generation fails.
///
pub fn main() {
pub(crate) fn main() {
// Define the path to the TOML file containing configuration.
let toml_file_path = "./tests/data/mylibrary.toml";

Expand Down
2 changes: 1 addition & 1 deletion examples/generate_from_yaml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use libmake::generator::generate_from_yaml;
///
/// * `Result<(), String>` - Returns `Ok(())` if the template files are generated successfully, or returns an error message if there is an error during generation.
///
pub fn main() {
pub(crate) fn main() {
// Specify the path to the YAML file to be used for generating templates.
let yaml_file_path = "./tests/data/mylibrary.yaml";

Expand Down
2 changes: 1 addition & 1 deletion examples/get_csv_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use libmake::utils::get_csv_field;
///
/// String containing the requested field
///
pub fn main() {
pub(crate) fn main() {
// Retrieve CSV field
let file_path = "../tests/data/mylibrary.csv";
println!(
Expand Down
2 changes: 1 addition & 1 deletion examples/get_json_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ use std::path::Path;
///
/// The value of the JSON field, or an empty string if the file does not exist or the field cannot be found
///
pub fn main() {
pub(crate) fn main() {
// Retrieve JSON field
let file_path = "../tests/data/mylibrary.json";
let field_author = "author";
Expand Down
2 changes: 1 addition & 1 deletion examples/get_yaml_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ use std::path::Path;
/// println!("🦀 get_yaml_field, ✅ {}: {}", field_keywords, value);
/// ```
///
pub fn main() {
pub(crate) fn main() {
let file_path = "../tests/data/mylibrary.yaml";
let field_keywords = "keywords";

Expand Down
41 changes: 0 additions & 41 deletions tests/test_loggers.rs

This file was deleted.

1 change: 0 additions & 1 deletion tests/test_macros.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#[cfg(test)]
mod tests {

extern crate libmake;
use libmake::generator::{
generate_files, generate_from_csv, generate_from_json,
generate_from_yaml,
Expand Down

0 comments on commit 179fd7f

Please sign in to comment.