escapeAssertion function
escapeAssertion escapes the dots in the assertion, because the expression evaluation doesn't support such variable names.
Implementation
String escapeAssertion(String s) {
s = s.replaceAll(RegExp(r'r\.'), 'r_');
s = s.replaceAll(RegExp(r'p\.'), 'p_');
return s;
}