Giter Site home page Giter Site logo

test_bokkypoobahsdatetimelibrary's Introduction

test_BokkyPooBahsDateTimeLibrary

Testing https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary using:

Parity 1.11.1 testnet (parity --no-persistent-txqueue --chain dev)

Ruby 2.4.2p198 on Windows 10, using the Ethereum.rb gem

Note that the number of requests handled by the Parity node was less than 100 per second, which limits the extent of testing possible.

Test Result

Code review: no issues identified

Testing: all tests passed, no errors were found

== exhaustive tests

[1] BPBDTL_ymd.rb -- 4 functions

Functions exhaustively tested from 1970 to 2286:

  • _isLeapYear
  • _getDaysInMonth
  • _daysFromDate
  • timestampFromDate

[2] BPBDTL_days_to_date.rb -- 1 function

Function exhaustively tested from 1970-01-01 to 2298-07-20:

  • _daysToDate

== tests using random data

[1] BPBDTL_ts.rb - 13 functions

Random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).

  • timestampToDate
  • timestamp_to_date_time
  • isLeapYear
  • isWeekDay
  • isWeekEnd
  • getDaysInMonth
  • getDayOfWeek
  • getYear
  • getMonth
  • getDay
  • getHour
  • getMinute
  • getSecond

First pass: checked each function 200_000 times

[2] BPBDTL_ts2.rb - 6 functions

Random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).

  • diffYears
  • diffMonths
  • diffDays
  • diffHours
  • diffMinutes
  • diffSeconds

First pass: checked each function 200_000 times

[3] BPDTL_timestamp_from_date_time.rb - 1 function

Random DateTime points between 1970-01-01 and 2299-12-31 23:59:59

  • timestampFromDateTime

First pass: checked 120_000 times

[4] BPBDTL_add_sub.rb - 12 functions

Adding to / subtracting from random time points between 1970-01-01 (0) and 2298-07-20 (10_000_000_000).

Adding / subtracting time periods of approximately 0-299 years

  • addYears
  • addMonths
  • addDays
  • addHours
  • addMinutes
  • addSeconds
  • subYears
  • subMonths
  • subDays
  • subHours
  • subMinutes
  • subSeconds

First pass: checked each function 100_000 times

Note: also checking that subtractions resulting in a date before 1970-01-01 00:00:00

test_bokkypoobahsdatetimelibrary's People

Contributors

alex-kampa avatar

Forkers

bokkypoobah

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.