test: Update to const and use regex for assertions
Checklist
-
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines
Affected core subsystem(s)
test
Description of change
Use const over var.
Assert error message with regex.
Warning
This PR changes Error message expectation and manipulating test to pass. Please be advised.