diff options
| author | Lukas Joeressen <[email protected]> | 2015-06-15 15:03:44 +0200 |
|---|---|---|
| committer | Lukas Joeressen <[email protected]> | 2015-06-15 15:03:44 +0200 |
| commit | 95fa22a65cf0866afaf3efd933a180509922f047 (patch) | |
| tree | 72f50a9690142f7edf03e236457cea25fbb38108 /mrbgems/mruby-time/test | |
| parent | 97a18ff4d9db48a72b3e63f2d6fd7c7958e98c97 (diff) | |
| download | mruby-95fa22a65cf0866afaf3efd933a180509922f047.tar.gz mruby-95fa22a65cf0866afaf3efd933a180509922f047.zip | |
Rounding errors could make time_alloc imprecise
Diffstat (limited to 'mrbgems/mruby-time/test')
| -rw-r--r-- | mrbgems/mruby-time/test/time.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mrbgems/mruby-time/test/time.rb b/mrbgems/mruby-time/test/time.rb index ba9b48fab..759e2881d 100644 --- a/mrbgems/mruby-time/test/time.rb +++ b/mrbgems/mruby-time/test/time.rb @@ -203,3 +203,11 @@ assert('day of week methods') do assert_false t.friday? assert_false t.saturday? end + +assert('2000 times 500us make a second') do + t = Time.utc 2015 + 2000.times do + t += 0.0005 + end + t.usec == 0 +end |
