MCPcopy Create free account
hub / github.com/gavv/httpexpect / TestNumber_InRange

Function TestNumber_InRange

number_test.go:514–634  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

512}
513
514func TestNumber_InRange(t *testing.T) {
515 t.Run("basic", func(t *testing.T) {
516 cases := []struct {
517 name string
518 number float64
519 min interface{}
520 max interface{}
521 wantInRange chainResult
522 wantNotInRange chainResult
523 }{
524 {
525 name: "range includes only number",
526 number: 1234,
527 min: 1234,
528 max: 1234,
529 wantInRange: success,
530 wantNotInRange: failure,
531 },
532 {
533 name: "range includes number and below",
534 number: 1234,
535 min: 1234 - 1,
536 max: 1234,
537 wantInRange: success,
538 wantNotInRange: failure,
539 },
540 {
541 name: "range includes number and above",
542 number: 1234,
543 min: 1234,
544 max: 1234 + 1,
545 wantInRange: success,
546 wantNotInRange: failure,
547 },
548 {
549 name: "range is above number",
550 number: 1234,
551 min: 1234 + 1,
552 max: 1234 + 2,
553 wantInRange: failure,
554 wantNotInRange: success,
555 },
556 {
557 name: "range is below number",
558 number: 1234,
559 min: 1234 - 2,
560 max: 1234 - 1,
561 wantInRange: failure,
562 wantNotInRange: success,
563 },
564 {
565 name: "range min is larger than max",
566 number: 1234,
567 min: 1234 + 1,
568 max: 1234 - 1,
569 wantInRange: failure,
570 wantNotInRange: success,
571 },

Callers

nothing calls this directly

Calls 5

newMockReporterFunction · 0.85
NewNumberFunction · 0.85
assertMethod · 0.80
InRangeMethod · 0.45
NotInRangeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…