vyre 0.4.0

GPU compute intermediate representation with a standard operation library
Documentation
use vyre::ops::string_matching::search_contract::NOT_FOUND;
use vyre::ops::string_matching::substring_find_first::substring_find_first;

/// Verify that substring_find_first returns the exact first occurrence offset.
#[test]
fn substring_find_first_returns_first_occurrence_offset() {
    let haystack = b"hello world world";
    let needle = b"world";
    let result = substring_find_first(haystack, needle).expect("Inputs within T47 caps");
    assert_eq!(result, 6);
}

/// Verify that substring_find_first returns NOT_FOUND when the needle is absent.
#[test]
fn substring_find_first_returns_not_found_when_absent() {
    let haystack = b"hello world";
    let needle = b"foo";
    let result = substring_find_first(haystack, needle).expect("Inputs within T47 caps");
    assert_eq!(result, NOT_FOUND);
}

/// Verify that substring_find_first returns zero for an empty needle.
#[test]
fn substring_find_first_returns_zero_for_empty_needle() {
    let haystack = b"hello world";
    let needle = b"";
    let result = substring_find_first(haystack, needle).expect("Inputs within T47 caps");
    assert_eq!(result, 0);
}