github.com/petergtz/pegomock@v2.9.1-0.20230424204322-eb0e044013df+incompatible/matcher_factories.go (about) 1 package pegomock 2 3 import ( 4 "reflect" 5 ) 6 7 func EqBool(value bool) bool { 8 RegisterMatcher(&EqMatcher{Value: value}) 9 return false 10 } 11 12 func NotEqBool(value bool) bool { 13 RegisterMatcher(&NotEqMatcher{Value: value}) 14 return false 15 } 16 17 func AnyBool() bool { 18 RegisterMatcher(NewAnyMatcher(reflect.TypeOf(false))) 19 return false 20 } 21 22 func BoolThat(matcher ArgumentMatcher) bool { 23 RegisterMatcher(matcher) 24 return false 25 } 26 27 func EqBoolSlice(value []bool) []bool { 28 RegisterMatcher(&EqMatcher{Value: value}) 29 return nil 30 } 31 32 func NotEqBoolSlice(value []bool) []bool { 33 RegisterMatcher(&NotEqMatcher{Value: value}) 34 return nil 35 } 36 37 func AnyBoolSlice() []bool { 38 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf(false)))) 39 return nil 40 } 41 42 func BoolSliceThat(matcher ArgumentMatcher) []bool { 43 RegisterMatcher(matcher) 44 return nil 45 } 46 47 func EqInt(value int) int { 48 RegisterMatcher(&EqMatcher{Value: value}) 49 return 0 50 } 51 52 func NotEqInt(value int) int { 53 RegisterMatcher(&NotEqMatcher{Value: value}) 54 return 0 55 } 56 57 func AnyInt() int { 58 RegisterMatcher(NewAnyMatcher(reflect.TypeOf(0))) 59 return 0 60 } 61 62 func IntThat(matcher ArgumentMatcher) int { 63 RegisterMatcher(matcher) 64 return 0 65 } 66 67 func EqIntSlice(value []int) []int { 68 RegisterMatcher(&EqMatcher{Value: value}) 69 return nil 70 } 71 72 func NotEqIntSlice(value []int) []int { 73 RegisterMatcher(&NotEqMatcher{Value: value}) 74 return nil 75 } 76 77 func AnyIntSlice() []int { 78 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf(0)))) 79 return nil 80 } 81 82 func IntSliceThat(matcher ArgumentMatcher) []int { 83 RegisterMatcher(matcher) 84 return nil 85 } 86 87 func EqInt8(value int8) int8 { 88 RegisterMatcher(&EqMatcher{Value: value}) 89 return 0 90 } 91 92 func NotEqInt8(value int8) int8 { 93 RegisterMatcher(&NotEqMatcher{Value: value}) 94 return 0 95 } 96 97 func AnyInt8() int8 { 98 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((int8)(0)))) 99 return 0 100 } 101 102 func Int8That(matcher ArgumentMatcher) int8 { 103 RegisterMatcher(matcher) 104 return 0 105 } 106 107 func EqInt8Slice(value []int8) []int8 { 108 RegisterMatcher(&EqMatcher{Value: value}) 109 return nil 110 } 111 112 func NotEqInt8Slice(value []int8) []int8 { 113 RegisterMatcher(&NotEqMatcher{Value: value}) 114 return nil 115 } 116 117 func AnyInt8Slice() []int8 { 118 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((int8)(0))))) 119 return nil 120 } 121 122 func Int8SliceThat(matcher ArgumentMatcher) []int8 { 123 RegisterMatcher(matcher) 124 return nil 125 } 126 127 func EqInt16(value int16) int16 { 128 RegisterMatcher(&EqMatcher{Value: value}) 129 return 0 130 } 131 132 func NotEqInt16(value int16) int16 { 133 RegisterMatcher(&NotEqMatcher{Value: value}) 134 return 0 135 } 136 137 func AnyInt16() int16 { 138 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((int16)(0)))) 139 return 0 140 } 141 142 func Int16That(matcher ArgumentMatcher) int16 { 143 RegisterMatcher(matcher) 144 return 0 145 } 146 147 func EqInt16Slice(value []int16) []int16 { 148 RegisterMatcher(&EqMatcher{Value: value}) 149 return nil 150 } 151 152 func NotEqInt16Slice(value []int16) []int16 { 153 RegisterMatcher(&NotEqMatcher{Value: value}) 154 return nil 155 } 156 157 func AnyInt16Slice() []int16 { 158 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((int16)(0))))) 159 return nil 160 } 161 162 func Int16SliceThat(matcher ArgumentMatcher) []int16 { 163 RegisterMatcher(matcher) 164 return nil 165 } 166 167 func EqInt32(value int32) int32 { 168 RegisterMatcher(&EqMatcher{Value: value}) 169 return 0 170 } 171 172 func NotEqInt32(value int32) int32 { 173 RegisterMatcher(&NotEqMatcher{Value: value}) 174 return 0 175 } 176 177 func AnyInt32() int32 { 178 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((int32)(0)))) 179 return 0 180 } 181 182 func Int32That(matcher ArgumentMatcher) int32 { 183 RegisterMatcher(matcher) 184 return 0 185 } 186 187 func EqInt32Slice(value []int32) []int32 { 188 RegisterMatcher(&EqMatcher{Value: value}) 189 return nil 190 } 191 192 func NotEqInt32Slice(value []int32) []int32 { 193 RegisterMatcher(&NotEqMatcher{Value: value}) 194 return nil 195 } 196 197 func AnyInt32Slice() []int32 { 198 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((int32)(0))))) 199 return nil 200 } 201 202 func Int32SliceThat(matcher ArgumentMatcher) []int32 { 203 RegisterMatcher(matcher) 204 return nil 205 } 206 207 func EqInt64(value int64) int64 { 208 RegisterMatcher(&EqMatcher{Value: value}) 209 return 0 210 } 211 212 func NotEqInt64(value int64) int64 { 213 RegisterMatcher(&NotEqMatcher{Value: value}) 214 return 0 215 } 216 217 func AnyInt64() int64 { 218 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((int64)(0)))) 219 return 0 220 } 221 222 func Int64That(matcher ArgumentMatcher) int64 { 223 RegisterMatcher(matcher) 224 return 0 225 } 226 227 func EqInt64Slice(value []int64) []int64 { 228 RegisterMatcher(&EqMatcher{Value: value}) 229 return nil 230 } 231 232 func NotEqInt64Slice(value []int64) []int64 { 233 RegisterMatcher(&NotEqMatcher{Value: value}) 234 return nil 235 } 236 237 func AnyInt64Slice() []int64 { 238 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((int64)(0))))) 239 return nil 240 } 241 242 func Int64SliceThat(matcher ArgumentMatcher) []int64 { 243 RegisterMatcher(matcher) 244 return nil 245 } 246 247 func EqUint(value uint) uint { 248 RegisterMatcher(&EqMatcher{Value: value}) 249 return 0 250 } 251 252 func NotEqUint(value uint) uint { 253 RegisterMatcher(&NotEqMatcher{Value: value}) 254 return 0 255 } 256 257 func AnyUint() uint { 258 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uint)(0)))) 259 return 0 260 } 261 262 func UintThat(matcher ArgumentMatcher) uint { 263 RegisterMatcher(matcher) 264 return 0 265 } 266 267 func EqUintSlice(value []uint) []uint { 268 RegisterMatcher(&EqMatcher{Value: value}) 269 return nil 270 } 271 272 func NotEqUintSlice(value []uint) []uint { 273 RegisterMatcher(&NotEqMatcher{Value: value}) 274 return nil 275 } 276 277 func AnyUintSlice() []uint { 278 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uint)(0))))) 279 return nil 280 } 281 282 func UintSliceThat(matcher ArgumentMatcher) []uint { 283 RegisterMatcher(matcher) 284 return nil 285 } 286 287 func EqUint8(value uint8) uint8 { 288 RegisterMatcher(&EqMatcher{Value: value}) 289 return 0 290 } 291 292 func NotEqUint8(value uint8) uint8 { 293 RegisterMatcher(&NotEqMatcher{Value: value}) 294 return 0 295 } 296 297 func AnyUint8() uint8 { 298 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uint8)(0)))) 299 return 0 300 } 301 302 func Uint8That(matcher ArgumentMatcher) uint8 { 303 RegisterMatcher(matcher) 304 return 0 305 } 306 307 func EqUint8Slice(value []uint8) []uint8 { 308 RegisterMatcher(&EqMatcher{Value: value}) 309 return nil 310 } 311 312 func NotEqUint8Slice(value []uint8) []uint8 { 313 RegisterMatcher(&NotEqMatcher{Value: value}) 314 return nil 315 } 316 317 func AnyUint8Slice() []uint8 { 318 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uint8)(0))))) 319 return nil 320 } 321 322 func Uint8SliceThat(matcher ArgumentMatcher) []uint8 { 323 RegisterMatcher(matcher) 324 return nil 325 } 326 327 func EqUint16(value uint16) uint16 { 328 RegisterMatcher(&EqMatcher{Value: value}) 329 return 0 330 } 331 332 func NotEqUint16(value uint16) uint16 { 333 RegisterMatcher(&NotEqMatcher{Value: value}) 334 return 0 335 } 336 337 func AnyUint16() uint16 { 338 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uint16)(0)))) 339 return 0 340 } 341 342 func Uint16That(matcher ArgumentMatcher) uint16 { 343 RegisterMatcher(matcher) 344 return 0 345 } 346 347 func EqUint16Slice(value []uint16) []uint16 { 348 RegisterMatcher(&EqMatcher{Value: value}) 349 return nil 350 } 351 352 func NotEqUint16Slice(value []uint16) []uint16 { 353 RegisterMatcher(&NotEqMatcher{Value: value}) 354 return nil 355 } 356 357 func AnyUint16Slice() []uint16 { 358 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uint16)(0))))) 359 return nil 360 } 361 362 func Uint16SliceThat(matcher ArgumentMatcher) []uint16 { 363 RegisterMatcher(matcher) 364 return nil 365 } 366 367 func EqUint32(value uint32) uint32 { 368 RegisterMatcher(&EqMatcher{Value: value}) 369 return 0 370 } 371 372 func NotEqUint32(value uint32) uint32 { 373 RegisterMatcher(&NotEqMatcher{Value: value}) 374 return 0 375 } 376 377 func AnyUint32() uint32 { 378 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uint32)(0)))) 379 return 0 380 } 381 382 func Uint32That(matcher ArgumentMatcher) uint32 { 383 RegisterMatcher(matcher) 384 return 0 385 } 386 387 func EqUint32Slice(value []uint32) []uint32 { 388 RegisterMatcher(&EqMatcher{Value: value}) 389 return nil 390 } 391 392 func NotEqUint32Slice(value []uint32) []uint32 { 393 RegisterMatcher(&NotEqMatcher{Value: value}) 394 return nil 395 } 396 397 func AnyUint32Slice() []uint32 { 398 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uint32)(0))))) 399 return nil 400 } 401 402 func Uint32SliceThat(matcher ArgumentMatcher) []uint32 { 403 RegisterMatcher(matcher) 404 return nil 405 } 406 407 func EqUint64(value uint64) uint64 { 408 RegisterMatcher(&EqMatcher{Value: value}) 409 return 0 410 } 411 412 func NotEqUint64(value uint64) uint64 { 413 RegisterMatcher(&NotEqMatcher{Value: value}) 414 return 0 415 } 416 417 func AnyUint64() uint64 { 418 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uint64)(0)))) 419 return 0 420 } 421 422 func Uint64That(matcher ArgumentMatcher) uint64 { 423 RegisterMatcher(matcher) 424 return 0 425 } 426 427 func EqUint64Slice(value []uint64) []uint64 { 428 RegisterMatcher(&EqMatcher{Value: value}) 429 return nil 430 } 431 432 func NotEqUint64Slice(value []uint64) []uint64 { 433 RegisterMatcher(&NotEqMatcher{Value: value}) 434 return nil 435 } 436 437 func AnyUint64Slice() []uint64 { 438 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uint64)(0))))) 439 return nil 440 } 441 442 func Uint64SliceThat(matcher ArgumentMatcher) []uint64 { 443 RegisterMatcher(matcher) 444 return nil 445 } 446 447 func EqUintptr(value uintptr) uintptr { 448 RegisterMatcher(&EqMatcher{Value: value}) 449 return 0 450 } 451 452 func NotEqUintptr(value uintptr) uintptr { 453 RegisterMatcher(&NotEqMatcher{Value: value}) 454 return 0 455 } 456 457 func AnyUintptr() uintptr { 458 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((uintptr)(0)))) 459 return 0 460 } 461 462 func UintptrThat(matcher ArgumentMatcher) uintptr { 463 RegisterMatcher(matcher) 464 return 0 465 } 466 467 func EqUintptrSlice(value []uintptr) []uintptr { 468 RegisterMatcher(&EqMatcher{Value: value}) 469 return nil 470 } 471 472 func NotEqUintptrSlice(value []uintptr) []uintptr { 473 RegisterMatcher(&NotEqMatcher{Value: value}) 474 return nil 475 } 476 477 func AnyUintptrSlice() []uintptr { 478 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((uintptr)(0))))) 479 return nil 480 } 481 482 func UintptrSliceThat(matcher ArgumentMatcher) []uintptr { 483 RegisterMatcher(matcher) 484 return nil 485 } 486 487 func EqFloat32(value float32) float32 { 488 RegisterMatcher(&EqMatcher{Value: value}) 489 return 0 490 } 491 492 func NotEqFloat32(value float32) float32 { 493 RegisterMatcher(&NotEqMatcher{Value: value}) 494 return 0 495 } 496 497 func AnyFloat32() float32 { 498 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((float32)(0)))) 499 return 0 500 } 501 502 func Float32That(matcher ArgumentMatcher) float32 { 503 RegisterMatcher(matcher) 504 return 0 505 } 506 507 func EqFloat32Slice(value []float32) []float32 { 508 RegisterMatcher(&EqMatcher{Value: value}) 509 return nil 510 } 511 512 func NotEqFloat32Slice(value []float32) []float32 { 513 RegisterMatcher(&NotEqMatcher{Value: value}) 514 return nil 515 } 516 517 func AnyFloat32Slice() []float32 { 518 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((float32)(0))))) 519 return nil 520 } 521 522 func Float32SliceThat(matcher ArgumentMatcher) []float32 { 523 RegisterMatcher(matcher) 524 return nil 525 } 526 527 func EqFloat64(value float64) float64 { 528 RegisterMatcher(&EqMatcher{Value: value}) 529 return 0 530 } 531 532 func NotEqFloat64(value float64) float64 { 533 RegisterMatcher(&NotEqMatcher{Value: value}) 534 return 0 535 } 536 537 func AnyFloat64() float64 { 538 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((float64)(0)))) 539 return 0 540 } 541 542 func Float64That(matcher ArgumentMatcher) float64 { 543 RegisterMatcher(matcher) 544 return 0 545 } 546 547 func EqFloat64Slice(value []float64) []float64 { 548 RegisterMatcher(&EqMatcher{Value: value}) 549 return nil 550 } 551 552 func NotEqFloat64Slice(value []float64) []float64 { 553 RegisterMatcher(&NotEqMatcher{Value: value}) 554 return nil 555 } 556 557 func AnyFloat64Slice() []float64 { 558 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((float64)(0))))) 559 return nil 560 } 561 562 func Float64SliceThat(matcher ArgumentMatcher) []float64 { 563 RegisterMatcher(matcher) 564 return nil 565 } 566 567 func EqComplex64(value complex64) complex64 { 568 RegisterMatcher(&EqMatcher{Value: value}) 569 return 0 570 } 571 572 func NotEqComplex64(value complex64) complex64 { 573 RegisterMatcher(&NotEqMatcher{Value: value}) 574 return 0 575 } 576 577 func AnyComplex64() complex64 { 578 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((complex64)(0)))) 579 return 0 580 } 581 582 func Complex64That(matcher ArgumentMatcher) complex64 { 583 RegisterMatcher(matcher) 584 return 0 585 } 586 587 func EqComplex64Slice(value []complex64) []complex64 { 588 RegisterMatcher(&EqMatcher{Value: value}) 589 return nil 590 } 591 592 func NotEqComplex64Slice(value []complex64) []complex64 { 593 RegisterMatcher(&NotEqMatcher{Value: value}) 594 return nil 595 } 596 597 func AnyComplex64Slice() []complex64 { 598 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((complex64)(0))))) 599 return nil 600 } 601 602 func Complex64SliceThat(matcher ArgumentMatcher) []complex64 { 603 RegisterMatcher(matcher) 604 return nil 605 } 606 607 func EqComplex128(value complex128) complex128 { 608 RegisterMatcher(&EqMatcher{Value: value}) 609 return 0 610 } 611 612 func NotEqComplex128(value complex128) complex128 { 613 RegisterMatcher(&NotEqMatcher{Value: value}) 614 return 0 615 } 616 617 func AnyComplex128() complex128 { 618 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((complex128)(0)))) 619 return 0 620 } 621 622 func Complex128That(matcher ArgumentMatcher) complex128 { 623 RegisterMatcher(matcher) 624 return 0 625 } 626 627 func EqComplex128Slice(value []complex128) []complex128 { 628 RegisterMatcher(&EqMatcher{Value: value}) 629 return nil 630 } 631 632 func NotEqComplex128Slice(value []complex128) []complex128 { 633 RegisterMatcher(&NotEqMatcher{Value: value}) 634 return nil 635 } 636 637 func AnyComplex128Slice() []complex128 { 638 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((complex128)(0))))) 639 return nil 640 } 641 642 func Complex128SliceThat(matcher ArgumentMatcher) []complex128 { 643 RegisterMatcher(matcher) 644 return nil 645 } 646 647 func EqString(value string) string { 648 RegisterMatcher(&EqMatcher{Value: value}) 649 return "" 650 } 651 652 func NotEqString(value string) string { 653 RegisterMatcher(&NotEqMatcher{Value: value}) 654 return "" 655 } 656 657 func AnyString() string { 658 RegisterMatcher(NewAnyMatcher(reflect.TypeOf(""))) 659 return "" 660 } 661 662 func StringThat(matcher ArgumentMatcher) string { 663 RegisterMatcher(matcher) 664 return "" 665 } 666 667 func EqStringSlice(value []string) []string { 668 RegisterMatcher(&EqMatcher{Value: value}) 669 return nil 670 } 671 672 func NotEqStringSlice(value []string) []string { 673 RegisterMatcher(&NotEqMatcher{Value: value}) 674 return nil 675 } 676 677 func AnyStringSlice() []string { 678 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf("")))) 679 return nil 680 } 681 682 func StringSliceThat(matcher ArgumentMatcher) []string { 683 RegisterMatcher(matcher) 684 return nil 685 } 686 687 func EqInterface(value interface{}) interface{} { 688 RegisterMatcher(&EqMatcher{Value: value}) 689 return nil 690 } 691 692 func NotEqInterface(value interface{}) interface{} { 693 RegisterMatcher(&NotEqMatcher{Value: value}) 694 return nil 695 } 696 697 func AnyInterface() interface{} { 698 RegisterMatcher(NewAnyMatcher(reflect.TypeOf((*interface{})(nil)).Elem())) 699 return nil 700 } 701 702 func InterfaceThat(matcher ArgumentMatcher) interface{} { 703 RegisterMatcher(matcher) 704 return nil 705 } 706 707 func EqInterfaceSlice(value []interface{}) []interface{} { 708 RegisterMatcher(&EqMatcher{Value: value}) 709 return nil 710 } 711 712 func NotEqInterfaceSlice(value []interface{}) []interface{} { 713 RegisterMatcher(&NotEqMatcher{Value: value}) 714 return nil 715 } 716 717 func AnyInterfaceSlice() []interface{} { 718 RegisterMatcher(NewAnyMatcher(reflect.SliceOf(reflect.TypeOf((*interface{})(nil)).Elem()))) 719 return nil 720 } 721 722 func InterfaceSliceThat(matcher ArgumentMatcher) []interface{} { 723 RegisterMatcher(matcher) 724 return nil 725 }