let (tt, _) = {
let source_file = ast::SourceFile::parse(input).ok().unwrap();
let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
- ast_to_token_tree(&tt).unwrap()
+ ast_to_token_tree(&tt)
};
let cfg = CfgExpr::parse(&tt);
assert_eq!(cfg, expected);
let (tt, _) = {
let source_file = ast::SourceFile::parse(input).ok().unwrap();
let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
- ast_to_token_tree(&tt).unwrap()
+ ast_to_token_tree(&tt)
};
let cfg = CfgExpr::parse(&tt);
let actual = format!("#![cfg({})]", DnfExpr::new(cfg));
let (tt, _) = {
let source_file = ast::SourceFile::parse(input).ok().unwrap();
let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
- ast_to_token_tree(&tt).unwrap()
+ ast_to_token_tree(&tt)
};
let cfg = CfgExpr::parse(&tt);
let dnf = DnfExpr::new(cfg);
let (tt, _) = {
let source_file = ast::SourceFile::parse(input).ok().unwrap();
let tt = source_file.syntax().descendants().find_map(ast::TokenTree::cast).unwrap();
- ast_to_token_tree(&tt).unwrap()
+ ast_to_token_tree(&tt)
};
let cfg = CfgExpr::parse(&tt);
let dnf = DnfExpr::new(cfg);