enso/build/macros/tests/plain.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

39 lines
927 B
Rust

// === Non-Standard Linter Configuration ===
#![allow(clippy::disallowed_names)]
use enso_build_base::prelude::*;
use itertools::Itertools;
use std::str::FromStr;
#[derive(enso_build_macros::Arg)]
pub enum Foo {
Foo,
BarBaz,
}
#[test]
fn hello() {
let foo = Foo::Foo;
assert_eq!(foo.as_ref(), OsStr::new("--foo"));
let args = foo.into_iter().collect_vec();
assert_eq!(args, vec![OsString::from("--foo")]);
let bar_baz = Foo::BarBaz;
assert_eq!(bar_baz.as_ref(), OsStr::new("--bar-baz"));
let args = bar_baz.into_iter().collect_vec();
assert_eq!(args, vec![OsString::from("--bar-baz")]);
}
#[test]
fn experiment_with_parsing() -> Result {
let code = "foo = ToString::to_string";
let token_stream = proc_macro2::TokenStream::from_str(code).unwrap();
dbg!(&token_stream);
let foo = syn::parse2::<syn::ExprAssign>(token_stream).unwrap();
dbg!(&foo);
Ok(())
}