Skip to content

Commit

Permalink
Updating crate attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
gawashburn committed Nov 30, 2024
1 parent ba322ba commit 182408a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(coverage_attribute)]
#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
///! Expose the knoll modules as part of a library. This is only really
/// necessary so that they will be visible in the `test` directory.
#[macro_use]
Expand Down
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
// Objective-C is needed by the core_graphics module.
// The core_graphics module also uses static_assertions to validate
// some data structures at compile time.
Expand Down
17 changes: 15 additions & 2 deletions tests/knoll_tests.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(coverage_attribute)]
#![cfg_attr(all(coverage_nightly, test), feature(coverage_attribute))]
extern crate knoll;

use coverage_helper::test;
Expand All @@ -7,7 +7,7 @@ use knoll::real_displays::*;
use tempfile;

#[test]
fn tmp_test() {
fn test_help() {
let mut vec_out: Vec<u8> = Vec::new();
let file_err = tempfile::tempfile().expect("Failed to create temporary file.");
let args = vec!["knoll", "help"];
Expand All @@ -18,3 +18,16 @@ fn tmp_test() {
file_err.try_clone().expect("Clone failed"),
);
}

#[test]
fn test_list() {
let mut vec_out: Vec<u8> = Vec::new();
let file_err = tempfile::tempfile().expect("Failed to create temporary file.");
let args = vec!["knoll", "list"];
let _ = run::<RealDisplayState, std::io::Stdin, &mut Vec<u8>, std::fs::File>(
&args.into_iter().map(|s| String::from(s)).collect(),
std::io::stdin(),
&mut vec_out,
file_err.try_clone().expect("Clone failed"),
);
}

0 comments on commit 182408a

Please sign in to comment.