Demo 17 - Validation Negative Tests

Abstract

Intentional failure tests using strict validation.

1 Full Table Import with Type Check (Strict)

Below we import table data.xlsx expecting exact structure: number, string, currency, number. Since the spreadsheet has intentional errors in the first and last data rows, the rendered table will flag explicit errors and the compiler would abort in a real production pipeline.

Table 1. Full Import (Excel)
ID Produto Receita (Esperado Moeda) Qtd (Esperado Num)
1 Cadeira Gamer [MC-WARN: Expected currency] [MC-WARN: Expected number]
2 Mouse R$ 120.00 50
3 [MC-WARN: Expected string] R$ 300.00 5
Source: Validation spreadsheet (data.xlsx)

And the corresponding version processed from LibreOffice (.ods) for visual and semantic comparison:

Table 2. Full Import (ODS)
ID Produto Receita (Esperado Moeda) Qtd (Esperado Num)
1 Cadeira Gamer [MC-WARN: Expected currency] [MC-WARN: Expected number]
2 Mouse R$120,00 50
3 [MC-WARN: Expected string] R$300,00 5
Source: Validation spreadsheet (data.ods)

2 Individual Cell Import (Inline)

It is also possible to check types on individual cells via \strictcell and \cell{..., expect="..."}:

From Excel (.xlsx):

And identical behavior from LibreOffice (.ods):