MCPcopy Create free account
hub / github.com/davidblewett/rure-python / empty

Function empty

regex/regex-syntax/src/hir/translate.rs:1359–1388  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1357
1358 #[test]
1359 fn empty() {
1360 assert_eq!(t(""), Hir::empty());
1361 assert_eq!(t("(?i)"), Hir::empty());
1362 assert_eq!(t("()"), hir_group(1, Hir::empty()));
1363 assert_eq!(t("(?:)"), hir_group_nocap(Hir::empty()));
1364 assert_eq!(t("(?P<wat>)"), hir_group_name(1, "wat", Hir::empty()));
1365 assert_eq!(t("|"), hir_alt(vec![Hir::empty(), Hir::empty()]));
1366 assert_eq!(t("()|()"), hir_alt(vec![
1367 hir_group(1, Hir::empty()),
1368 hir_group(2, Hir::empty()),
1369 ]));
1370 assert_eq!(t("(|b)"), hir_group(1, hir_alt(vec![
1371 Hir::empty(),
1372 hir_lit("b"),
1373 ])));
1374 assert_eq!(t("(a|)"), hir_group(1, hir_alt(vec![
1375 hir_lit("a"),
1376 Hir::empty(),
1377 ])));
1378 assert_eq!(t("(a||c)"), hir_group(1, hir_alt(vec![
1379 hir_lit("a"),
1380 Hir::empty(),
1381 hir_lit("c"),
1382 ])));
1383 assert_eq!(t("(||)"), hir_group(1, hir_alt(vec![
1384 Hir::empty(),
1385 Hir::empty(),
1386 Hir::empty(),
1387 ])));
1388 }
1389
1390 #[test]
1391 fn literal() {

Callers 15

concatMethod · 0.70
alternationMethod · 0.70
dotMethod · 0.70
anyMethod · 0.70
dropMethod · 0.70
visit_preMethod · 0.70
visit_postMethod · 0.70
hir_litFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected