Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasets: add unit tests #32

Open
ocramz opened this issue Jan 2, 2019 · 7 comments
Open

datasets: add unit tests #32

ocramz opened this issue Jan 2, 2019 · 7 comments
Labels
documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@ocramz
Copy link
Member

ocramz commented Jan 2, 2019

Some unit tests asserting e.g. the length or some other property of the datasets would be nice to have.

@ocramz ocramz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers documentation labels Jan 2, 2019
@Magalame
Copy link
Contributor

I've been interested in contributing to this project for a while! Is it ok if I take a shot at this issue?
I think maybe checking the length, the first and the last element of every dataset could constitute the tests.

@ocramz
Copy link
Member Author

ocramz commented Mar 1, 2019

Hi @Magalame , any contribution large or small is very welcome ^^

@Magalame
Copy link
Contributor

Hi again!
I was wondering if it wouldn't be more practical to using some form of hashing? Maybe something like hashable?

@ocramz
Copy link
Member Author

ocramz commented Apr 1, 2019

@Magalame how would you use hashing for this ?

@Magalame
Copy link
Contributor

Magalame commented Apr 3, 2019

I think I misunderstood the purpose of the issue, I thought it was to check the integrity of the data

@Magalame
Copy link
Contributor

Magalame commented May 7, 2019

Actually I think there is a reasonable way to use hashing for this. We basically want unit tests to make sure that the functions in datasets load the data sets properly.

So a nice way to do that would be, approximately, for each data set:

do
    abas <- getDataset abalone

    head abas `shouldBe` valueOfHeadOfAbas
    last abas `shouldBe` valueOfLastOfAbas
    force (hash abas) `shouldBe` fixedHash

and then the same for getDatavec

It would have the advantage of partly solving #29. And Haskell has a nice Hashable class

@Magalame
Copy link
Contributor

Magalame commented May 9, 2019

ping @ocramz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants