• Stars
    star
    185
  • Rank 208,271 (Top 5 %)
  • Language
    Scala
  • License
    GNU Lesser Genera...
  • Created almost 10 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Random Data Generation and/or Property Testing in Scala & Scala.JS.

Nyaya

Nyaya is a Scala/Scala.JS library to:

  • Test properties using random data.
  • Prove properties with (reasonably-sized) finite domains.
  • Assert properties in real data.
  • Generate random data.
  • Ensure uniqueness in random data.

It is:

  • Fast. Probably the fastest Scala random data gen / prop tester. (Benchmarks coming soon…)
  • Has a nice, fluent API for generating random data. (examples)
scala> import nyaya.gen._
import nyaya.gen._

scala> val g = Gen.int mapTo Gen.boolean.option
g: nyaya.gen.Gen[Map[Int,Option[Boolean]]] = Gen(<function1>)

scala> g.samples().take(1).foreach(println)
Map(609117252 -> None, -339 -> Some(true), 1684851879 -> Some(false), 78379 -> None)

SBT setup

ver nyayaVer = "1.1.0"

// Property expression, evaluation, assertion.
libraryDependencies += "com.github.japgolly.nyaya" %%% "nyaya-prop" % nyayaVer

// Random data generation.
libraryDependencies += "com.github.japgolly.nyaya" %%% "nyaya-gen" % nyayaVer

// Random JSON generation
libraryDependencies += "com.github.japgolly.nyaya" %%% "nyaya-gen-circe" % nyayaVer

// Property testing with random data.
// Property proving.
libraryDependencies += "com.github.japgolly.nyaya" %%% "nyaya-test" % nyayaVer % Test

Doc


Requires:

  • Scala 2.13+
  • Scala.JS 1.10+ (optional)

What does Nyaya mean?

See:


Support

If you like what I do β€”my OSS libraries, my contributions to other OSS libs, my programming blogβ€” and you'd like to support me, more content, more lib maintenance, please become a patron! I do all my OSS work unpaid so showing your support will make a big difference.


Licence

Copyright (C) 2014-2022 David Barri

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

More Repositories

1

scalajs-react

Facebook's React on Scala.JS
Scala
1,644
star
2

svg-android

Fork of svg-android +SVN history +Maven +more
Java
568
star
3

scalacss

Super type-safe CSS for Scala and Scala.JS.
Scala
339
star
4

scala-graal

Make usage of Graal features easy and safe from Scala. Also features Scala-based React SSR.
Scala
194
star
5

test-state

Scala Test-State.
Scala
141
star
6

clear-config

Scala FP configuration library with a focus on runtime clarity
Scala
140
star
7

scalajs-benchmark

Benchmarks: write in Scala or JS, run in your browser. Live demo:
Scala
72
star
8

univeq

Safer universal equivalence (==) for Scala.
Scala
59
star
9

learning

Scala
46
star
10

setup-everything-scala

GitHub Action to prepare the environment for Scala & Scala.JS dev and testing
Scala
40
star
11

mr.boilerplate

Online app to generate Scala boilerplate
Scala
33
star
12

microlibs-scala

Scala
26
star
13

tla2json

Convert TLA+ output (and values) into JSON
Scala
24
star
14

webtamp

Asset bundler. Companion to bundlers like Webpack.
TypeScript
20
star
15

webapp-util

Scala Webapp Utilities
Scala
17
star
16

scala-restructure

Scala
9
star
17

misc

4
star
18

archlinux-packages

Shell
2
star
19

setup-scalajs

GitHub Action to prepare the environment for Scala.JS dev and testing
JavaScript
2
star
20

rubyprof-test

Ruby
1
star
21

setup-scala-util

GitHub Action to add Scala utilities to the PATH
Scala
1
star
22

ruby-corvid

Ruby
1
star
23

astacus

Ruby
1
star
24

autotag2

Years-old app to tag MP3s.
Ruby
1
star
25

android-test-utils

Java
1
star
26

text_to_diagram

Generate software diagrams (ERDs, DFDs, etc) using text files, rather than spending hours combating visual tools.
Ruby
1
star
27

ruby-golly-utils

Ruby
1
star