MCPcopy Create free account
hub / github.com/containers/image / TestIdentifierRegexp

Function TestIdentifierRegexp

docker/reference/regexp_test.go:495–525  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

493}
494
495func TestIdentifierRegexp(t *testing.T) {
496 fullCases := []regexpMatch{
497 {
498 input: "da304e823d8ca2b9d863a3c897baeb852ba21ea9a9f1414736394ae7fcaf9821",
499 match: true,
500 },
501 {
502 input: "7EC43B381E5AEFE6E04EFB0B3F0693FF2A4A50652D64AEC573905F2DB5889A1C",
503 match: false,
504 },
505 {
506 input: "da304e823d8ca2b9d863a3c897baeb852ba21ea9a9f1414736394ae7fcaf",
507 match: false,
508 },
509 {
510 input: "sha256:da304e823d8ca2b9d863a3c897baeb852ba21ea9a9f1414736394ae7fcaf9821",
511 match: false,
512 },
513 {
514 input: "da304e823d8ca2b9d863a3c897baeb852ba21ea9a9f1414736394ae7fcaf98218482",
515 match: false,
516 },
517 }
518
519 for i := range fullCases {
520 checkRegexp(t, anchoredIdentifierRegexp, fullCases[i])
521 if IsFullIdentifier(fullCases[i].input) != fullCases[i].match {
522 t.Errorf("Expected match for %q to be %v", fullCases[i].input, fullCases[i].match)
523 }
524 }
525}

Callers

nothing calls this directly

Calls 2

checkRegexpFunction · 0.85
IsFullIdentifierFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…