Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CSHARP-3355: Add more spec tests for invalid relaxed UUIDs. #452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
DmitryLukyanov merged 1 commit into mongodb:master from DmitryLukyanov:csharp3355
Feb 18, 2021

Conversation

@DmitryLukyanov
Copy link
Contributor

@DmitryLukyanov DmitryLukyanov commented Feb 5, 2021

{
throw new FormatException($"Invalid $uuid hyphens format: '{uuidTokenStringValue}'.");
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can replace lines 2093-2112 with:

var guid = Guid.Parse(uuidToken.StringValue);
var binaryData = new BsonBinaryData(guid, GuidRepresentation.Standard);

Guid.Parse already does all the validations we need.

Copy link
Contributor Author

@DmitryLukyanov DmitryLukyanov Feb 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, done

Copy link
Contributor Author

@jyemin jyemin removed the request for review from JamesKovacs February 5, 2021 19:43
Copy link
Contributor

jyemin commented Feb 5, 2021

Removed James since Robert picked it up.

Copy link
Contributor

@rstam rstam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Verified that:

  • BsonBinarySubType is still set correctly.
  • Same exception type (FormatException) is thrown as before.
  • Tests run successfully.

One minor change required. You have an extraneous using statement.

using System.Globalization;
using System.IO;
using System.Text.RegularExpressions;
using System.Linq;
Copy link
Contributor

@JamesKovacs JamesKovacs Feb 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used.

DmitryLukyanov reacted with thumbs up emoji
Copy link
Contributor Author

@DmitryLukyanov DmitryLukyanov Feb 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@JamesKovacs JamesKovacs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JamesKovacs JamesKovacs JamesKovacs approved these changes

@rstam rstam rstam approved these changes

@jyemin jyemin Awaiting requested review from jyemin

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /