Skip to content

Commit d171f64

Browse files
author
thk123
committed
Swap finding variable values to use regex
1 parent 99c21ed commit d171f64

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

unit/java_bytecode/java_bytecode_convert_method/convert_invoke_dynamic.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
struct lambda_assignment_test_datat
1818
{
19-
irep_idt lambda_variable_id;
19+
std::regex lambda_variable_id;
2020
irep_idt lambda_interface;
2121
std::string lambda_interface_method_descriptor;
2222
irep_idt lambda_function_id;
@@ -111,14 +111,16 @@ SCENARIO(
111111
require_goto_statements::get_all_statements(
112112
symbol_table.lookup_ref("java::LocalLambdas.test:()V").value);
113113

114-
const std::string function_prefix = "java::LocalLambdas.test:()V";
114+
const std::string function_prefix_regex_str =
115+
"java::LocalLambdas\\.test:\\(\\)V";
115116

116117
THEN(
117118
"The local variable should be assigned a temp object implementing "
118119
"SimpleLambda")
119120
{
120121
lambda_assignment_test_datat test_data;
121-
test_data.lambda_variable_id = function_prefix + "::11::simpleLambda";
122+
test_data.lambda_variable_id =
123+
std::regex(function_prefix_regex_str + "::\\d+::simpleLambda$");
122124

123125
test_data.lambda_interface = "java::SimpleLambda";
124126
test_data.lambda_interface_method_descriptor = ".Execute:()V";
@@ -130,7 +132,8 @@ SCENARIO(
130132
"parameter interface implementor")
131133
{
132134
lambda_assignment_test_datat test_data;
133-
test_data.lambda_variable_id = function_prefix + "::35::paramLambda";
135+
test_data.lambda_variable_id =
136+
std::regex(function_prefix_regex_str + "::\\d+::paramLambda$");
134137

135138
test_data.lambda_interface = "java::ParameterLambda";
136139
test_data.lambda_interface_method_descriptor =

0 commit comments

Comments
 (0)