messages.go 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package assertions
  2. const (
  3. shouldHaveBeenEqual = "Expected: '%v'\nActual: '%v'\n(Should be equal)"
  4. shouldHaveBeenEqualNoResemblance = "Both the actual and expected values render equally ('%s') and their types are the same. Try using ShouldResemble instead."
  5. shouldNotHaveBeenEqual = "Expected '%v'\nto NOT equal '%v'\n(but it did)!"
  6. shouldHaveBeenEqualTypeMismatch = "Expected: '%v' (%T)\nActual: '%v' (%T)\n(Should be equal, type mismatch)"
  7. shouldHaveBeenAlmostEqual = "Expected '%v' to almost equal '%v' (but it didn't)!"
  8. shouldHaveNotBeenAlmostEqual = "Expected '%v' to NOT almost equal '%v' (but it did)!"
  9. shouldHaveResembled = "Expected: '%s'\nActual: '%s'\n(Should resemble)!"
  10. shouldNotHaveResembled = "Expected '%#v'\nto NOT resemble '%#v'\n(but it did)!"
  11. shouldBePointers = "Both arguments should be pointers "
  12. shouldHaveBeenNonNilPointer = shouldBePointers + "(the %s was %s)!"
  13. shouldHavePointedTo = "Expected '%+v' (address: '%v') and '%+v' (address: '%v') to be the same address (but their weren't)!"
  14. shouldNotHavePointedTo = "Expected '%+v' and '%+v' to be different references (but they matched: '%v')!"
  15. shouldHaveBeenNil = "Expected: nil\nActual: '%v'"
  16. shouldNotHaveBeenNil = "Expected '%+v' to NOT be nil (but it was)!"
  17. shouldHaveBeenTrue = "Expected: true\nActual: %v"
  18. shouldHaveBeenFalse = "Expected: false\nActual: %v"
  19. shouldHaveBeenZeroValue = "'%+v' should have been the zero value" //"Expected: (zero value)\nActual: %v"
  20. shouldNotHaveBeenZeroValue = "'%+v' should NOT have been the zero value"
  21. shouldHaveBeenGreater = "Expected '%v' to be greater than '%v' (but it wasn't)!"
  22. shouldHaveBeenGreaterOrEqual = "Expected '%v' to be greater than or equal to '%v' (but it wasn't)!"
  23. shouldHaveBeenLess = "Expected '%v' to be less than '%v' (but it wasn't)!"
  24. shouldHaveBeenLessOrEqual = "Expected '%v' to be less than or equal to '%v' (but it wasn't)!"
  25. shouldHaveBeenBetween = "Expected '%v' to be between '%v' and '%v' (but it wasn't)!"
  26. shouldNotHaveBeenBetween = "Expected '%v' NOT to be between '%v' and '%v' (but it was)!"
  27. shouldHaveDifferentUpperAndLower = "The lower and upper bounds must be different values (they were both '%v')."
  28. shouldHaveBeenBetweenOrEqual = "Expected '%v' to be between '%v' and '%v' or equal to one of them (but it wasn't)!"
  29. shouldNotHaveBeenBetweenOrEqual = "Expected '%v' NOT to be between '%v' and '%v' or equal to one of them (but it was)!"
  30. shouldHaveContained = "Expected the container (%v) to contain: '%v' (but it didn't)!"
  31. shouldNotHaveContained = "Expected the container (%v) NOT to contain: '%v' (but it did)!"
  32. shouldHaveBeenAValidCollection = "You must provide a valid container (was %v)!"
  33. shouldHaveContainedKey = "Expected the %v to contain the key: %v (but it didn't)!"
  34. shouldNotHaveContainedKey = "Expected the %v NOT to contain the key: %v (but it did)!"
  35. shouldHaveBeenAValidMap = "You must provide a valid map type (was %v)!"
  36. shouldHaveBeenIn = "Expected '%v' to be in the container (%v), but it wasn't!"
  37. shouldNotHaveBeenIn = "Expected '%v' NOT to be in the container (%v), but it was!"
  38. shouldHaveBeenEmpty = "Expected %+v to be empty (but it wasn't)!"
  39. shouldNotHaveBeenEmpty = "Expected %+v to NOT be empty (but it was)!"
  40. shouldHaveBeenAValidInteger = "You must provide a valid integer (was %v)!"
  41. shouldHaveBeenAValidLength = "You must provide a valid positive integer (was %v)!"
  42. shouldHaveHadLength = "Expected collection to have length equal to [%v], but it's length was [%v] instead! contents: %+v"
  43. shouldHaveStartedWith = "Expected '%v'\nto start with '%v'\n(but it didn't)!"
  44. shouldNotHaveStartedWith = "Expected '%v'\nNOT to start with '%v'\n(but it did)!"
  45. shouldHaveEndedWith = "Expected '%v'\nto end with '%v'\n(but it didn't)!"
  46. shouldNotHaveEndedWith = "Expected '%v'\nNOT to end with '%v'\n(but it did)!"
  47. shouldAllBeStrings = "All arguments to this assertion must be strings (you provided: %v)."
  48. shouldBothBeStrings = "Both arguments to this assertion must be strings (you provided %v and %v)."
  49. shouldHaveContainedSubstring = "Expected '%s' to contain substring '%s' (but it didn't)!"
  50. shouldNotHaveContainedSubstring = "Expected '%s' NOT to contain substring '%s' (but it did)!"
  51. shouldBeString = "The argument to this assertion must be a string (you provided %v)."
  52. shouldHaveBeenBlank = "Expected '%s' to be blank (but it wasn't)!"
  53. shouldNotHaveBeenBlank = "Expected value to NOT be blank (but it was)!"
  54. shouldUseVoidNiladicFunction = "You must provide a void, niladic function as the first argument!"
  55. shouldHavePanicked = "Expected func() to panic (but it didn't)!"
  56. shouldNotHavePanicked = "Expected func() NOT to panic (error: '%+v')!"
  57. shouldHavePanickedWith = "Expected func() to panic with '%v' (but it panicked with '%v')!"
  58. shouldNotHavePanickedWith = "Expected func() NOT to panic with '%v' (but it did)!"
  59. shouldHaveBeenA = "Expected '%v' to be: '%v' (but was: '%v')!"
  60. shouldNotHaveBeenA = "Expected '%v' to NOT be: '%v' (but it was)!"
  61. shouldHaveImplemented = "Expected: '%v interface support'\nActual: '%v' does not implement the interface!"
  62. shouldNotHaveImplemented = "Expected '%v'\nto NOT implement '%v'\n(but it did)!"
  63. shouldCompareWithInterfacePointer = "The expected value must be a pointer to an interface type (eg. *fmt.Stringer)"
  64. shouldNotBeNilActual = "The actual value was 'nil' and should be a value or a pointer to a value!"
  65. shouldBeError = "Expected an error value (but was '%v' instead)!"
  66. shouldBeErrorInvalidComparisonValue = "The final argument to this assertion must be a string or an error value (you provided: '%v')."
  67. shouldUseTimes = "You must provide time instances as arguments to this assertion."
  68. shouldUseTimeSlice = "You must provide a slice of time instances as the first argument to this assertion."
  69. shouldUseDurationAndTime = "You must provide a duration and a time as arguments to this assertion."
  70. shouldHaveHappenedBefore = "Expected '%v' to happen before '%v' (it happened '%v' after)!"
  71. shouldHaveHappenedAfter = "Expected '%v' to happen after '%v' (it happened '%v' before)!"
  72. shouldHaveHappenedBetween = "Expected '%v' to happen between '%v' and '%v' (it happened '%v' outside threshold)!"
  73. shouldNotHaveHappenedOnOrBetween = "Expected '%v' to NOT happen on or between '%v' and '%v' (but it did)!"
  74. // format params: incorrect-index, previous-index, previous-time, incorrect-index, incorrect-time
  75. shouldHaveBeenChronological = "The 'Time' at index [%d] should have happened after the previous one (but it didn't!):\n [%d]: %s\n [%d]: %s (see, it happened before!)"
  76. shouldNotHaveBeenchronological = "The provided times should NOT be chronological, but they were."
  77. )