File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
module/move/unilang/tests Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1+ //! Test module for verifying list argument parsing and validation functionality.
2+ //!
3+ //! This module tests the unilang framework's ability to handle list-type command arguments
4+ //! with validation rules, specifically ensuring that list arguments with minimum item
5+ //! constraints are properly parsed and validated during command execution.
6+
17use unilang:: prelude:: * ;
28use unilang:: ValidationRule ;
39use unilang_parser:: { Parser , UnilangParserOptions } ;
@@ -34,8 +40,8 @@ fn arg_list_test() -> Result< (), unilang::Error >
3440 (
3541 OutputData
3642 {
37- content : "" . to_string ( ) ,
38- format : "" . to_string ( ) ,
43+ content : String :: new ( ) ,
44+ format : String :: new ( ) ,
3945 }
4046 )
4147 }
@@ -44,7 +50,7 @@ fn arg_list_test() -> Result< (), unilang::Error >
4450
4551 let parser = Parser :: new ( UnilangParserOptions :: default ( ) ) ;
4652
47- let input = ".region.buy_castle 1 1" ;
53+ let input = ".region.buy_castle coord::1, 1" ;
4854 let instructions = [ parser. parse_single_instruction ( input ) . map_err ( unilang:: Error :: from ) ? ] ;
4955 let semantic_analyzer = unilang:: semantic:: SemanticAnalyzer :: new ( & instructions[ .. ] , & registry ) ;
5056 let commands = semantic_analyzer. analyze ( ) ?;
You can’t perform that action at this time.
0 commit comments