Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Add unary plus#253

Merged
trotterdylan merged 2 commits intogoogle:masterfrom
S-YOU:add_unary_plus
Feb 17, 2017
Merged

Add unary plus#253
trotterdylan merged 2 commits intogoogle:masterfrom
S-YOU:add_unary_plus

Conversation

@S-YOU
Copy link
Copy Markdown
Contributor

@S-YOU S-YOU commented Feb 16, 2017

No description provided.

@S-YOU S-YOU force-pushed the add_unary_plus branch 3 times, most recently from 0a10ba2 to 89ff3d5 Compare February 16, 2017 04:50
Copy link
Copy Markdown
Contributor

@trotterdylan trotterdylan left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. This looks great. Just one suggestion for an additional test.

Comment thread runtime/core_test.go
{args: wrapArgs(42), want: NewInt(42).ToObject()},
{args: wrapArgs(1.2), want: NewFloat(1.2).ToObject()},
{args: wrapArgs(NewLong(big.NewInt(123))), want: NewLong(big.NewInt(123)).ToObject()},
{args: wrapArgs("foo"), wantExc: mustCreateException(TypeErrorType, "bad operand type for unary +: 'str'")},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would you mind adding a test for a type that implements __pos__?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added one, something like that?

Copy link
Copy Markdown
Contributor

@trotterdylan trotterdylan left a comment

Choose a reason for hiding this comment

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

This is great! Thanks for the PR. Merging.

@trotterdylan trotterdylan merged commit 9ca28dd into google:master Feb 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants