09.03 - Asserts

'file' does 'contain' {regex}

What: This assertion searches a pattern inside a File resource. If the pattern is not found, the assertion fails.

ASSERT {resource<file>} DOES contain THE $(<pattern>)

Note: For differences between ASSERT and VERIFY assertion mode see this page this page

Input:

    • resource<Res:file>: The name (in the context) of the file resource. (Resource of category file)

    • <pattern>: The regular expression searched in the file.

Note: If you want to check for special characters used in the regular expression formalism, you will have to escape them with a backslash ("\").

Example:

LOAD filechecker/FFF_txt_test.txt AS fixed_field_file.file

ASSERT fixed_field_file.file DOES contain THE $(Hello)

'file' does 'not.contain' {regex}

What: This assertion verifies that a pattern is not present inside a File resource. If the pattern is found, the assertion fails.

ASSERT {resource<Res:file>} DOES not.contain THE $(<pattern>)

Note: For differences between ASSERT and VERIFY assertion mode see this page this page

Input:

    • resource<Res:file>: The name (in the context) of the file resource. (Resource of category file)

    • <pattern>: The regular expression character searched in the file.

Note: If you want to check for special characters used in the regular expression formalism, you will have to escape them with a backslash ("\").

Example:

LOAD filechecker/FFF_txt_test.txt AS fixed_field_file.file

ASSERT fixed_field_file.file DOES not.contain THE $(Hello)

'fixed.field.file' is 'valid'

What: This assertion verifies that a fixed.field.file resource is valid (structure and syntax)

ASSERT {fffResource<Res:fixed.field.file>} IS valid

Note: For differences between ASSERT and VERIFY assertion mode see this page this page

Input:

    • fffResource<Res:fixed.field.file>: The name (in the context) of the fixed field file resource to validate (Resource of category fixed.field.file)

Example:

LOAD filechecker/descriptor_txt_test.xml AS fixed_field_file_descriptor.file

CONVERT fixed_field_file_descriptor.file TO fixed.field.file.descriptor (descriptor) AS fixed_field_file_descriptor.descriptor

LOAD filechecker/FFF_txt_test.txt AS fixed_field_file.file

CONVERT fixed_field_file.file TO fixed.field.file (structured) USING fixed_field_file_descriptor.descriptor AS fixed_field_file.fff

ASSERT fixed_field_file.fff IS valid

'fixed.field.file' has 'expected.autonumbers'

What: This assertion verifies that a fixed.field.file resource has the expected auto numbers.

ASSERT {fffResource<Res:fixed.field.file>} HAS expected.autonumbers

Note: For differences between ASSERT and VERIFY assertion mode see this page this page

Input:

    • fffResource<Res:fixed.field.file>: The name of the fixed field file resource to verify (Resource of category fixed.field.file)

Example:

LOAD filechecker/descriptor_txt_test.xml AS fixed_field_file_descriptor.file

CONVERT fixed_field_file_descriptor.file TO fixed.field.file.descriptor (descriptor) AS fixed_field_file_descriptor.descriptor

LOAD filechecker/FFF_txt_test.txt AS fixed_field_file.file

CONVERT fixed_field_file.file TO fixed.field.file (structured) USING fixed_field_file_descriptor.descriptor AS fixed_field_file.fff

ASSERT fixed_field_file.fff HAS expected.autonumbers

'fixed.field.file' has 'expected.content'

What: This assertion verifies a fixed.field.file resource has the expected content. The expected content is defined in the fixed field file queries resource provided in the USING clause.

ASSERT {fffResource<Res:fixed.field.file>} HAS expected.content USING {fffQueries<Res:fixed.field.file.queries>}

Note: For differences between ASSERT and VERIFY assertion mode see this page this page

Input:

    • fffResource<Res:fixed.field.file>: The name (in the context) of the fixed field file resource to verify (Resource of category fixed.field.file)

    • fffQueries<Res:fixed.field.file.queries>: The name (in the context) of the fixed field file queries which contains the expected contents (Resource of category fixed.field.file.queries)

Example:

LOAD filechecker/descriptor_txt_test.xml AS fixed_field_file_descriptor.file

CONVERT fixed_field_file_descriptor.file TO fixed.field.file.descriptor (descriptor) AS fixed_field_file_descriptor.descriptor

LOAD filechecker/FFF_txt_test.txt AS fixed_field_file.file

CONVERT fixed_field_file.file TO fixed.field.file (structured) USING fixed_field_file_descriptor.descriptor AS fixed_field_file.fff

LOAD filechecker/FFF_queries_txt_test.xml AS fixed_field_file_queries.file

CONVERT fixed_field_file_queries.file TO fixed.field.file.queries (query) AS fixed_field_file_queries.query

ASSERT fixed_field_file.fff HAS expected.content USING fixed_field_file_queries.query