Module inline_c::predicates[][src]

Expand description

Re-export the prelude of the predicates crate, which is useful for assertions.

Example

An end of line on all systems are represented by the \n character, except on Windows where it is \r\n. Even if C writes \n, it will be translated into \r\n, so we need to normalize this. This is where the predicates crate can be helpful.

use inline_c::{assert_c, predicates::*};

fn test_predicates() {
    (assert_c! {
        #include <stdio.h>

        int main() {
            printf("Hello, World!\n");

            return 0;
        }
    })
    .success()
    .stdout(predicate::eq("Hello, World!\n").normalize());
}

Modules

predicate

Predicate factories

Traits

Predicate

Trait for generically evaluating a type against a dynamically created predicate function.

PredicateBooleanExt

Predicate extension that adds boolean logic.

PredicateBoxExt

Predicate extension for boxing a Predicate.

PredicateFileContentExt

Predicate extension adapting a slice Predicate.

PredicateNameExt

Predicate extension that adds naming predicate expressions.

PredicateStrExt

Predicate extension adapting a str Predicate.