Skip to content

Commit 4045d07

Browse files
docs: precise the mechanism comment on the quoted-string Set fallback test
State the exact error (ErrMoreThanOneSeq from CanScan() being true post-literal, before EOF) rather than the looser "fails doddish scanning into an object-id-shaped seq" -- caught during pre-merge review. :clown: Generated with [Clown](https://code.linenisgreat.com/clown) 0.3.22+995b3fa Commit: https://code.linenisgreat.com/clown/commit/995b3fa880dbbf62333ccfb2f224c2d0b6595d40
1 parent 215047d commit 4045d07

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

go/internal/bravo/ids/main2_test.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ func TestIdWriteToReadFrom(t1 *testing.T) {
4040
}
4141
}
4242

43-
// A quoted-literal value fails doddish scanning into an object-id-shaped
44-
// seq, but on a fresh (genres.Unknown) ObjectId, Set's error-fallback path
45-
// re-routes to SetBlob, which itself falls back to wrapping the RAW string
46-
// (quote characters included) in a single TokenTypeIdentifier token and
47-
// unconditionally sets Genre to Blob -- producing a Blob object-id
48-
// literally named `"quoted value"`, quotes and all, rather than erroring
49-
// or stripping the quotes. This is surprising but is the actual, tested
50-
// contract: quoting has no special meaning to Set on a genre-less
51-
// ObjectId, it's just characters in a blob name.
43+
// A quoted-literal value scans as a single TokenTypeLiteral token, but
44+
// ScanExactlyOneSeqWithDotAllowedInIdenfierFromString still reports
45+
// ErrMoreThanOneSeq (CanScan() is true post-literal, before EOF is
46+
// observed) -- so Set's error-fallback path re-routes to SetBlob, which
47+
// wraps the RAW string (quote characters included) in a single
48+
// TokenTypeIdentifier token and unconditionally sets Genre to Blob,
49+
// producing a Blob object-id literally named `"quoted value"`, quotes
50+
// and all, rather than erroring or stripping the quotes. This is
51+
// surprising but is the actual, tested contract: quoting has no special
52+
// meaning to Set on a genre-less ObjectId, it's just characters in a
53+
// blob name.
5254
func TestSetOnQuotedStringProducesLiteralBlobName(t1 *testing.T) {
5355
t := ui.MakeT(t1)
5456

0 commit comments

Comments
 (0)