mirror of
				https://github.com/SillyTavern/SillyTavern.git
				synced 2025-06-05 21:59:27 +02:00 
			
		
		
		
	Test case for legacy single-colon syntax
This commit is contained in:
		| @@ -339,6 +339,22 @@ describe('MacroLexer', () => { | |||||||
|  |  | ||||||
|             expect(tokens).toEqual(expectedTokens); |             expect(tokens).toEqual(expectedTokens); | ||||||
|         }); |         }); | ||||||
|  |         // {{roll:1d4}} | ||||||
|  |         it('should handle argument with legacy one colon syntax to start the arguments', async () => { | ||||||
|  |             const input = '{{roll:1d4}}'; | ||||||
|  |             const tokens = await runLexerGetTokens(input); | ||||||
|  |  | ||||||
|  |             const expectedTokens = [ | ||||||
|  |                 { type: 'Macro.Start', text: '{{' }, | ||||||
|  |                 { type: 'Macro.Identifier', text: 'roll' }, | ||||||
|  |                 { type: 'Args.Colon', text: ':' }, | ||||||
|  |                 { type: 'Unknown', text: '1' }, | ||||||
|  |                 { type: 'Identifier', text: 'd4' }, | ||||||
|  |                 { type: 'Macro.End', text: '}}' }, | ||||||
|  |             ]; | ||||||
|  |  | ||||||
|  |             expect(tokens).toEqual(expectedTokens); | ||||||
|  |         }); | ||||||
|         // {{random "this" "and that" "and some more"}} |         // {{random "this" "and that" "and some more"}} | ||||||
|         it('should handle multiple unnamed arguments in quotation marks', async () => { |         it('should handle multiple unnamed arguments in quotation marks', async () => { | ||||||
|             const input = '{{random "this" "and that" "and some more"}}'; |             const input = '{{random "this" "and that" "and some more"}}'; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user