@@ -1272,8 +1272,8 @@ func collectionErrorMessageCases() iter.Seq[failCase] {
12721272 name : "truncation/NotSubset(longSlice)" ,
12731273 assertion : func (t T ) bool { return NotSubset (t , longSlice , longSlice ) },
12741274 wantContains : []string {
1275- `['\x00' '\x00' '\x00' ` ,
1276- `<... truncated> is a subset of ['\x00' '\x00' '\x00' ` ,
1275+ `[]int{0, 0, 0, ` ,
1276+ `<... truncated> is a subset of []int{0, 0, 0, ` ,
12771277 },
12781278 },
12791279 {
@@ -1282,9 +1282,40 @@ func collectionErrorMessageCases() iter.Seq[failCase] {
12821282 return NotSubset (t , map [int ][]int {1 : longSlice }, map [int ][]int {1 : longSlice })
12831283 },
12841284 wantContains : []string {
1285- `map['\x01':['\x00' '\x00' '\x00'` ,
1286- `<... truncated> is a subset of map['\x01':['\x00' '\x00' '\x00'` ,
1285+ `map[int][]int{1:[]int{0, 0, 0,` ,
1286+ `<... truncated> is a subset of map[int][]int{1:[]int{0, 0, 0,` ,
1287+ },
1288+ },
1289+
1290+ // NotSubset/SliceNotSubsetT fail messages — regression coverage for
1291+ // upstream stretchr/testify#1800 / #1848: previously %q produced
1292+ // broken output like "%!q(bool=true)" or "'\x01'" for non-string types.
1293+ {
1294+ name : "NotSubset(bools)" ,
1295+ assertion : func (t T ) bool { return NotSubset (t , []bool {true }, []bool {true }) },
1296+ wantContains : []string {`[]bool{true} is a subset of []bool{true}` },
1297+ },
1298+ {
1299+ name : "NotSubset(ints)" ,
1300+ assertion : func (t T ) bool { return NotSubset (t , []int {1 , 2 , 3 }, []int {1 , 2 }) },
1301+ wantContains : []string {`[]int{1, 2} is a subset of []int{1, 2, 3}` },
1302+ },
1303+ {
1304+ name : "NotSubset(map-int)" ,
1305+ assertion : func (t T ) bool {
1306+ return NotSubset (t , map [int ]string {1 : "one" }, map [int ]string {1 : "one" })
12871307 },
1308+ wantContains : []string {`map[int]string{1:"one"} is a subset of map[int]string{1:"one"}` },
1309+ },
1310+ {
1311+ name : "SliceNotSubsetT(bools)" ,
1312+ assertion : func (t T ) bool { return SliceNotSubsetT (t , []bool {true }, []bool {true }) },
1313+ wantContains : []string {`[]bool{true} is a subset of []bool{true}` },
1314+ },
1315+ {
1316+ name : "SliceNotSubsetT(ints)" ,
1317+ assertion : func (t T ) bool { return SliceNotSubsetT (t , []int {1 , 2 , 3 }, []int {1 , 2 }) },
1318+ wantContains : []string {`[]int{1, 2} is a subset of []int{1, 2, 3}` },
12881319 },
12891320 })
12901321}
0 commit comments