Log Surgeon
Test & API docs
Loading...
Searching...
No Matches
Buffer parser identifying variable tokens on newlines.

Tests covering how BufferParser categorizes variable tokens appearing at the start of new lines, including interaction with static-text, delimiters, and capture group repetition. More...

Functions

void multi_line_with_newline_static_var_sequence ()
 Test variable after static-text at the start of a newline when previous line ends in a variable.
void multi_line_with_static_newline_static_var_sequence ()
 Test variable after static-text at start of newline when previous line ends in static-text.
void multi_line_with_static_newline_var_sequence ()
 Test variable at start of newline when previous line ends in static-text.
void multi_line_with_static_newline_var_newline_sequence ()
 Test variable followed by newline at start of newline when previous line ends in static-text.
void multi_line_with_delim_newline_var_sequence ()
 Test a variable at start of a newline when previous line ends in a delimiter.

Detailed Description

Tests covering how BufferParser categorizes variable tokens appearing at the start of new lines, including interaction with static-text, delimiters, and capture group repetition.

These tests verify correct tokenization and recognition of variables and delimiters when variables occur on new lines, especially following different token types.

Function Documentation

◆ multi_line_with_delim_newline_var_sequence()

void multi_line_with_delim_newline_var_sequence ( )

Test a variable at start of a newline when previous line ends in a delimiter.

This test verifies that if a line ends with a delimiter (e.g., space) and the next line starts with an integer variable, the BufferParser correctly identifies the tokens including the newline.

Schema Definition

delimiters: \n\r\[:,
int: \-{0,1}[0-9]+

Input Example

"1234567 \n1234567"

Expected Logtype

"<int> \n"
"<int>"

Expected Tokenization

"1234567" -> "int"
" " -> uncaught string
"\n" -> uncaught string
"1234567" -> "int"

◆ multi_line_with_newline_static_var_sequence()

void multi_line_with_newline_static_var_sequence ( )

Test variable after static-text at the start of a newline when previous line ends in a variable.

This test verifies that when a line ends with a variable token and the next line starts with static text followed by an integer variable, the BufferParser correctly recognizes the newline as a delimiter and parses the tokens appropriately.

Schema Definition

delimiters: \n\r\[:,
int: \-{0,1}[0-9]+

Test Input

"1234567\nText 1234567"

Expected Logtype

"<int><newLine>"
"Text <int>"

Expected Tokenization

"1234567" -> "int"
"\n" -> "newLine"
"Text" -> uncaught string
" 1234567" -> "int"

◆ multi_line_with_static_newline_static_var_sequence()

void multi_line_with_static_newline_static_var_sequence ( )

Test variable after static-text at start of newline when previous line ends in static-text.

This test verifies that when a line ends with static text and the next line starts with static text followed by an integer variable, the BufferParser identifies the newline properly and tokenizes the input correctly.

Schema Definition

delimiters: \n\r\[:,
int: \-{0,1}[0-9]+

Test Input

"1234567 abc\nText 1234567"

Expected Logtype

"<int> abc<newLine>"
"Text <int>"

Expected Tokenization

"1234567" -> "int"
" abc" -> uncaught string
"\n" -> "newLine"
"Text" -> uncaught string
" 1234567" -> "int"

◆ multi_line_with_static_newline_var_newline_sequence()

void multi_line_with_static_newline_var_newline_sequence ( )

Test variable followed by newline at start of newline when previous line ends in static-text.

This test verifies that when a line ends with static text, and the next line contains an integer variable followed by a newline, the BufferParser correctly separates the tokens, recognizing the newline delimiter.

Schema Definition

delimiters: \n\r\[:,
int: \-{0,1}[0-9]+

Test Input

"1234567 abc\n1234567\n"

Expected Logtype

"<int> abc\n"
"<int><newLine>"

Expected Tokenization

"1234567" -> "int"
" abc" -> uncaught string
"\n" -> uncaught string
"1234567" -> "int"
"\n" -> "newLine"

◆ multi_line_with_static_newline_var_sequence()

void multi_line_with_static_newline_var_sequence ( )

Test variable at start of newline when previous line ends in static-text.

This test verifies that when a line ends with static text and the next line starts directly with an integer variable, the BufferParser treats the newline and variable token correctly.

Schema Definition

delimiters: \n\r\[:,
int: \-{0,1}[0-9]+

Test Input

"1234567 abc\n1234567"

Expected Logtype

"<int> abc\n"
"<int>"

Expected Tokenization

"1234567" -> "int"
" abc" -> uncaught string
"\n" -> uncaught string
"1234567" -> "int"