Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
-   re: #2
  • Loading branch information
SignpostMarv committed Oct 1, 2024
1 parent d9c46ea commit b6c5e1e
Showing 1 changed file with 72 additions and 16 deletions.
88 changes: 72 additions & 16 deletions tests/lib/CustomParsingTypes/UnrealEngineString.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,26 @@ const general_regex =
regex_uppercase
}][A-Za-z0-9_]+)?|[${
regex_uppercase
}][${
}0-9][${
regex_alpha
}_]+\\.[${
regex_uppercase
}][${
}0-9][${
regex_alpha
}_]+)`;

const right_regex_suffix =
`(?:[${
`(?:_?[${
regex_uppercase
}][${
}0-9][${
regex_alpha
}0-9_.]+/)*[${
regex_uppercase
}][${
}0-9][${
regex_alpha
}_.0-9-]+(?::[${
regex_uppercase
}][${
}0-9][${
regex_alpha
}0-9]+)?`;

Expand All @@ -78,59 +78,107 @@ void describe('UnrealEngineString', () => {
general_regex
}|"${
general_regex
}")')`,
}")'|"(?:/Script/Engine.BlueprintGeneratedClass)'${
general_regex
}'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'${
general_regex
}'\\\\")`,
],
[
{left: 'foo'},
`(?:(?:foo)'(?:${
general_regex
}|"${
general_regex
}")')`,
}")'|"(?:foo)'${
general_regex
}'"|\\\\"(?:foo)'${
general_regex
}'\\\\")`,
],
[
{left: ['foo']},
`(?:(?:foo)'(?:${
general_regex
}|"${
general_regex
}")')`,
}")'|"(?:foo)'${
general_regex
}'"|\\\\"(?:foo)'${
general_regex
}'\\\\")`,
],
[
{left: ['foo', 'bar']},
`(?:(?:foo|bar)'(?:${
general_regex
}|"${
general_regex
}")')`,
}")'|"(?:foo|bar)'${
general_regex
}'"|\\\\"(?:foo|bar)'${
general_regex
}'\\\\")`,
],
[
{right: 'foo'},
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo)|"(?:foo)")')`,
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:${
'(?:foo)'
}|"${
'(?:foo)'
}")'|"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo)'
}'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo)'
}'\\\\")`,
],
[
{right: ['foo']},
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo)|"(?:foo)")')`,
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:${
'(?:foo)'
}|"${
'(?:foo)'
}")'|"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo)'
}'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo)'
}'\\\\")`,
],
[
{right: ['foo', 'bar']},
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo|bar)|"(?:foo|bar)")')`,
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:${
'(?:foo|bar)'
}|"${
'(?:foo|bar)'
}")'|"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo|bar)'
}'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'${
'(?:foo|bar)'
}'\\\\")`,
],
[
{right: {starts_with: 'foo'}},
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:(?:foo${
right_regex_suffix
}))|"(?:(?:foo${
right_regex_suffix
}))")')`,
}))")'|"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}))'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}))'\\\\")`,
],
[
{right: {starts_with: ['foo']}},
`(?:(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:(?:foo${
right_regex_suffix
}))|"(?:(?:foo${
right_regex_suffix
}))")')`,
}))")'|"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}))'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}))'\\\\")`,
],
[
{right: {starts_with: ['foo', 'bar']}},
Expand All @@ -142,7 +190,15 @@ void describe('UnrealEngineString', () => {
right_regex_suffix
}|bar${
right_regex_suffix
}))")')`,
}))")'|"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}|bar${
right_regex_suffix
}))'"|\\\\"(?:/Script/Engine.BlueprintGeneratedClass)'(?:(?:foo${
right_regex_suffix
}|bar${
right_regex_suffix
}))'\\\\")`,
],
];
const inner = UnrealEngineString.ajv_macro_generator(
Expand Down

0 comments on commit b6c5e1e

Please sign in to comment.