enso/build/macros/tests/with_arg.rs
Michał Wawrzyniec Urbańczyk 483028dbb0
Cloud dispatch & fixes (#3843)
This PR updates the build script:
* fixed issue where program version check was not properly triggering;
* improved `git-clean` command to correctly clear Scala artifacts;
* added `run.ps1` wrapper to the build script that works better with PowerShell than `run.cmd`;
* increased timeouts to work around failures on macOS nightly builds;
* replaced depracated GitHub Actions APIs (set-output) with their new equivalents;
* workaround for issue with electron builder (python2 lookup) on newer macOS runner images;
* GUI and backend dispatches to cloud were completed;
* release workflow allows creating RC releases.
2022-11-09 00:15:26 +01:00

33 lines
748 B
Rust

use enso_build_base::prelude::*;
use itertools::Itertools;
#[derive(enso_build_macros::Arg)]
pub enum Foo {
Bar,
BarBaz(String),
HogeHoge(OsString),
// #[arg(format = ToString::to_string)]
// TaraPon(u32),
}
#[test]
fn test_argument_formatting() {
let bar = Foo::Bar;
assert_eq!(bar.into_iter().collect_vec(), vec![OsString::from("--bar")]);
let bar_baz = Foo::BarBaz("foo".into());
assert_eq!(bar_baz.into_iter().collect_vec(), vec![
OsString::from("--bar-baz"),
OsString::from("foo")
]);
let hoge_hoge = Foo::HogeHoge(OsString::from("foo"));
assert_eq!(hoge_hoge.into_iter().collect_vec(), vec![
OsString::from("--hoge-hoge"),
OsString::from("foo")
]);
}