MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / test_regexp_split_array

Function test_regexp_split_array

src/regexp/src/lib.rs:103–242  ·  view source on GitHub ↗

too slow

()

Source from the content-addressed store, hash-verified

101 #[mz_ore::test]
102 #[cfg_attr(miri, ignore)] // too slow
103 fn test_regexp_split_array() {
104 // Expected outputs generated from postgres.
105 struct TestCase {
106 text: &'static str,
107 regexp: &'static str,
108 expect: &'static [&'static str],
109 }
110 let tests = vec![
111 TestCase {
112 text: "",
113 regexp: "",
114 expect: &[""],
115 },
116 TestCase {
117 text: "",
118 regexp: "\\s",
119 expect: &[""],
120 },
121 TestCase {
122 text: "",
123 regexp: "\\s+",
124 expect: &[""],
125 },
126 TestCase {
127 text: "",
128 regexp: "\\s*",
129 expect: &[""],
130 },
131 TestCase {
132 text: " ",
133 regexp: "",
134 expect: &[" "],
135 },
136 TestCase {
137 text: " ",
138 regexp: "\\s",
139 expect: &["", ""],
140 },
141 TestCase {
142 text: " ",
143 regexp: "\\s+",
144 expect: &["", ""],
145 },
146 TestCase {
147 text: " ",
148 regexp: "\\s*",
149 expect: &["", ""],
150 },
151 TestCase {
152 text: " ",
153 regexp: "",
154 expect: &[" ", " "],
155 },
156 TestCase {
157 text: " ",
158 regexp: "\\s",
159 expect: &["", "", ""],
160 },

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.80
build_regexFunction · 0.70
regexp_split_to_arrayFunction · 0.70

Tested by

no test coverage detected