Code Monkey home page Code Monkey logo

fakeit's Issues

Panic when using datetime::date_range

I'm receiving the following panic when I'm calling fakeit::datetime::date_range.

You can see the minimum (date_birth_min) and maximum (date_birth_max) values which I'm passing into the function.

date_birth_min = 1910-08-27T22:57:50.591270Z
date_birth_max = 1999-05-08T22:57:50.591310Z
thread 'tokio-runtime-worker' panicked at 'invalid or out-of-range datetime', src/libcore/option.rs:1185:5
stack backtrace:
   0: std::io::Read::read_exact
   1: core::fmt::ArgumentV1::show_usize
   2: std::io::Write::write_fmt
   3: std::panicking::default_hook::{{closure}}
   4: std::panicking::default_hook
   5: <std::panicking::begin_panic::PanicPayload<A> as core::panic::BoxMeUp>::get
   6: std::panicking::continue_panic_fmt
   7: std::panicking::try::do_call
   8: std::thread::local::fast::Key<T>::try_initialize
   9: std::thread::local::fast::Key<T>::try_initialize
  10: core::option::Option<T>::expect
             at /private/tmp/rust-20191221-83947-1gnlhtt/rustc-1.40.0-src/src/libcore/option.rs:345
  11: chrono::naive::datetime::NaiveDateTime::from_timestamp
             at /Users/nathansculli/.cargo/registry/src/github.com-1ecc6299db9ec823/chrono-0.4.10/src/naive/datetime.rs:110
  12: fakeit::datetime::date_range
             at /Users/nathansculli/.cargo/registry/src/github.com-1ecc6299db9ec823/fakeit-1.0.0/src/datetime.rs:66

README typo

Reported from Reddit.

A minor typo in the README:

In the examples for user_agent you have use fakeit::unique; but you should have use fakeit::user_agent;

Support Creating Data Based On Seeds

Repeatable fake data is very important for testing use cases:

  • Integration tests where access to the original object is difficult or impossible. Example: one system creates data to be consumed by another system. The expected output is based on a transformation of the original data, and without hard coding, testing would essentially need to re-implement the system just for the test, defeating the purpose.
  • Allowing debugging exact failure cases.
  • Better understand of regressions.
  • Even if random seeds are used, knowing the seeds to identify and fix flakey tests.

implementation:
At minimum, creating a local FakeIt as such, should be possible:

FakeIt::new(2314907).word();

Ideally you would also be able to set a global seed for ergonomics, so you do not have to create a FakeIt instance.

Generator tags

Add all of the possible tags to the resolve_tag function in generator.rs

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.