// =====================================================================
TextInputFormatScriptGenerator generator =
new TextInputFormatScriptGenerator(resolverMock,
new TextInputFormatParser(false));
XFTextInputAttributes attributes = new XFTextInputAttributes();
attributes.setName("abc");
attributes.setErrmsg(new LiteralTextAssetReference("error message"));
attributes.setCaption(new LiteralTextAssetReference("caption"));
attributes.setStyles(StylesBuilder.getSparseStyles(
"mcs-input-format: \"M:M\""));
StringBuffer buffer = new StringBuffer();
generator.writeJavaScriptValidation(attributes, buffer);
assertEquals("if(!(new RegEx(\"Z\",form.abc.value).match())) {\n" +