MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / slice_insertion

Function slice_insertion

cranelift/bforest/src/lib.rs:154–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152
153 #[test]
154 fn slice_insertion() {
155 let mut a = ['a', 'b', 'c', 'd'];
156
157 slice_insert(&mut a[0..1], 0, 'e');
158 assert_eq!(a, ['e', 'b', 'c', 'd']);
159
160 slice_insert(&mut a, 0, 'a');
161 assert_eq!(a, ['a', 'e', 'b', 'c']);
162
163 slice_insert(&mut a, 3, 'g');
164 assert_eq!(a, ['a', 'e', 'b', 'g']);
165
166 slice_insert(&mut a, 1, 'h');
167 assert_eq!(a, ['a', 'h', 'e', 'b']);
168 }
169
170 #[test]
171 fn slice_shifting() {

Callers

nothing calls this directly

Calls 1

slice_insertFunction · 0.85

Tested by

no test coverage detected