mirror of
https://github.com/clap-rs/clap
synced 2025-03-04 23:37:32 +00:00
Auto merge of #359 - kbknapp:appveyor_test, r=Vinatorul
Added appveyor for windows build tests. **Do not merge, yet**
This commit is contained in:
commit
15512b834c
6 changed files with 24 additions and 7 deletions
|
@ -1,6 +1,8 @@
|
|||
# clap
|
||||
|
||||
[](https://travis-ci.org/kbknapp/clap-rs) [](https://crates.io/crates/clap) [](https://github.com/kbknapp/clap-rs/blob/master/LICENSE-MIT) [](https://coveralls.io/github/kbknapp/clap-rs?branch=master) [](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](https://travis-ci.org/kbknapp/clap-rs)
|
||||
[](https://ci.appveyor.com/project/kbknapp/clap-rs/branch/master)
|
||||
[](https://crates.io/crates/clap) [](https://github.com/kbknapp/clap-rs/blob/master/LICENSE-MIT) [](https://coveralls.io/github/kbknapp/clap-rs?branch=master) [](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
Command Line Argument Parser for Rust
|
||||
|
||||
|
|
12
appveyor.yml
Normal file
12
appveyor.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
install:
|
||||
- ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-nightly-i686-pc-windows-gnu.exe'
|
||||
- rust-nightly-i686-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
|
||||
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
|
||||
- rustc -V
|
||||
- cargo -V
|
||||
|
||||
build: false
|
||||
|
||||
test_script:
|
||||
- cargo build --features yaml
|
||||
- cargo test --no-default-features --features yaml
|
|
@ -497,10 +497,11 @@ pub enum ClapErrorType {
|
|||
UnexpectedMultipleUsage,
|
||||
/// Error occurs when argument contains invalid unicode characters
|
||||
///
|
||||
/// **Note:** Non-Windows OS only
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```no_run
|
||||
/// ```ignore
|
||||
/// # use clap::{App, Arg};
|
||||
/// # use std::os::unix::ffi::OsStringExt;
|
||||
/// # use std::ffi::OsString;
|
||||
|
|
|
@ -55,7 +55,7 @@ impl<T: fmt::Display> fmt::Display for Format<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, feature = "color", not(target_os = "windows")))]
|
||||
mod test {
|
||||
use super::Format;
|
||||
use ansi_term::Colour::{Green, Red, Yellow};
|
||||
|
|
|
@ -72,7 +72,7 @@ pub enum DidYouMeanMessageStyle {
|
|||
EnumValue,
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, features = "suggestions"))]
|
||||
mod test {
|
||||
use super::*;
|
||||
|
||||
|
@ -81,6 +81,5 @@ mod test {
|
|||
let p_vals = ["test", "possible", "values"];
|
||||
assert_eq!(did_you_mean("tst", p_vals.iter()), Some("test"));
|
||||
assert!(did_you_mean("hahaahahah", p_vals.iter()).is_none());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
extern crate clap;
|
||||
|
||||
use std::ffi::OsString;
|
||||
#[cfg(not(windows))]
|
||||
use std::os::unix::ffi::OsStringExt;
|
||||
use clap::{App, Arg, ClapErrorType};
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(not(windows), test)]
|
||||
#[cfg(not(windows))]
|
||||
fn invalid_unicode_safe() {
|
||||
let m = App::new("bad_unicode")
|
||||
.arg(Arg::from_usage("<arg> 'some arg'"))
|
||||
|
@ -16,7 +18,8 @@ fn invalid_unicode_safe() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(not(windows), test)]
|
||||
#[cfg(not(windows))]
|
||||
fn invalid_unicode_lossy() {
|
||||
if let Ok(m) = App::new("bad_unicode")
|
||||
.arg(Arg::from_usage("<arg> 'some arg'"))
|
||||
|
|
Loading…
Add table
Reference in a new issue