Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
78cb8040
Commit
78cb8040
authored
May 13, 2017
by
Andreas Eger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change test for nanosecond accurate timestamps
parent
ad203bcb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
well_known_types_test.rb
ruby/tests/well_known_types_test.rb
+5
-2
No files found.
ruby/tests/well_known_types_test.rb
View file @
78cb8040
...
...
@@ -13,15 +13,18 @@ class TestWellKnownTypes < Test::Unit::TestCase
assert_equal
Time
.
at
(
12345
),
ts
.
to_time
assert_equal
12345
,
ts
.
to_i
# millisecond accuracy
time
=
Time
.
at
(
123456
,
654321
)
ts
.
from_time
(
time
)
assert_equal
123456
,
ts
.
seconds
assert_equal
654321000
,
ts
.
nanos
assert_equal
time
,
ts
.
to_time
time
=
Time
.
now
# nanosecond accuracy
time
=
Time
.
at
(
123456
,
Rational
(
654321321
,
1000
))
ts
.
from_time
(
time
)
assert_equal
time
.
to_f
,
ts
.
to_time
.
to_f
assert_equal
654321321
,
ts
.
nanos
assert_equal
time
,
ts
.
to_time
end
def
test_duration
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment