Simplified doc-site generation
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.4_AGL_Test_Framework / 5_Reference / 4_LuaUnit_Assertion_Functions / 3_String_Assertions.md
1 ---
2 edit_link: ''
3 title: String Assertions
4 origin_url: >-
5   https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/LuaUnitAssertionFunctions/3_StringAssertions.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
9
10 # String assertions
11
12 Assertions related to string and patterns.
13
14 * **_AFT.assertStrContains(str, sub[, useRe])**
15
16     Assert that a string contains the given substring or pattern.
17
18     By default, substring is searched in the string. If useRe is provided and is
19     true, sub is treated as a pattern which is searched inside the string str.
20
21 * **_AFT.assertStrIContains(str, sub)**
22
23     Assert that a string contains the given substring, irrespective of the case.
24
25     Not that unlike assertStrcontains(), you can not search for a pattern.
26
27 * **_AFT.assertNotStrContains(str, sub, useRe)**
28
29     Assert that a string does not contain a given substring or pattern.
30
31     By default, substring is searched in the string. If useRe is provided and is
32     true, sub is treated as a pattern which is searched inside the string str.
33
34 * **_AFT.assertNotStrIContains(str, sub)**
35
36     Assert that a string does not contain the given substring, irrespective of
37     the case.
38
39     Not that unlike assertNotStrcontains(), you can not search for a pattern.
40
41 * **_AFT.assertStrMatches(str, pattern[, start[, final]])**
42
43     Assert that a string matches the full pattern pattern.
44
45     If start and final are not provided or are nil, the pattern must match the
46     full string, from start to end. The functions allows to specify the expected
47     start and end position of the pattern in the string.