-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathtests.rs
42 lines (38 loc) · 1.13 KB
/
tests.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use plc_ast::{
ast::{AstFactory, AstNode},
literals::AstLiteral,
};
use plc_source::source_location::SourceLocation;
// Copyright (c) 2020 Ghaith Hachem and Mathias Rieder
mod ast_visitor_tests;
mod class_parser_tests;
mod container_parser_tests;
mod control_parser_tests;
mod expressions_parser_tests;
mod function_parser_tests;
mod initializer_parser_tests;
mod interface_parser_tests;
mod misc_parser_tests;
mod parse_errors;
mod parse_generics;
mod program_parser_tests;
mod property_parser_tests;
mod statement_parser_tests;
mod type_parser_tests;
mod variable_parser_tests;
/// helper function to create references
pub fn ref_to(name: &str) -> AstNode {
AstFactory::create_member_reference(
AstFactory::create_identifier(name, SourceLocation::internal(), 0),
None,
0,
)
}
/// helper function to create literal ints
pub fn literal_int(value: i128) -> AstNode {
AstNode::new_literal(AstLiteral::new_integer(value), 0, SourceLocation::internal())
}
/// helper function to create empty statements
pub fn empty_stmt() -> AstNode {
AstFactory::create_empty_statement(SourceLocation::internal(), 0)
}