cmake_parser/doc/command/scripting/
break.rs1use cmake_parser_derive::CMake;
2
3use crate::doc::command_scope::{CommandScope, ToCommandScope};
4
5#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9#[cmake(pkg = "crate")]
10pub struct Break;
11
12impl ToCommandScope for Break {
13 fn to_command_scope(&self) -> CommandScope {
14 CommandScope::Scripting
15 }
16}
17
18#[cfg(test)]
19mod tests {
20 use super::*;
21 use crate::*;
22 use pretty_assertions::assert_eq;
23
24 #[test]
25 fn r#break() {
26 let src = include_bytes!("../../../../../fixture/commands/scripting/break");
27 let cmakelists = parse_cmakelists(src).unwrap();
28 let doc = Doc::from(cmakelists);
29 assert_eq!(doc.commands(), Ok(vec![Command::Break(Box::new(Break)),]))
30 }
31}