Published on :

MIME type verification via %mp_assert macro

This code is also available in: Deutsch Español Français
The script uses the `%mp_assert` macro, typically employed in unit testing frameworks like SASUnit. It evaluates a logical condition (`iftrue`) that compares the value returned by the call to the `%mf_mimetype('XLS')` macro with the string 'application/vnd.ms-excel'. This assertion aims to confirm that the `%mf_mimetype` macro produces the correct MIME type for XLS files. A description ('Checking correct value') is associated with the assertion to facilitate tracking of test results.
Data Analysis

Type : N/A


This script does not involve the manipulation or reading of SAS or external data. Its objective is purely functional: to test the value returned by a utility macro (%mf_mimetype) and not to process datasets.

1 Code Block
MACRO CALL
Explanation :
This code block invokes the `%mp_assert` macro. This macro is designed for assertions within a unit testing context. The `iftrue` argument contains the logical expression to be evaluated: `"%mf_mimetype(XLS)"="application/vnd.ms-excel"`. If this expression is true, the assertion passes; otherwise, it fails. The `desc` parameter provides a textual description of the assertion's objective.
Copied!
1%mp_assert(
2 iftrue=("%mf_mimetype(XLS)"="application/vnd.ms-excel"),
3 desc=Checking correct value
4)
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.