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

README corrections #70

Open
george-hawkins opened this issue Sep 6, 2016 · 0 comments
Open

README corrections #70

george-hawkins opened this issue Sep 6, 2016 · 0 comments

Comments

@george-hawkins
Copy link

Sorry - normally I'd submit a pull request for this kind of thing but unfortunately I don't have time.

Many people new to the project will start by working through the examples in the README so it's relatively important that it be mistake free. Here are some issues I found:

1. I had to change the following code:

intercept[ArithmeticException]{
  b()
}
assert(b.toTry.isInstanceOf[Failure])

To this:

intercept[ArithmeticException]{
  b.now // Otherwise it complains "No implicit Ctx.Data is available here!"
}
assert(b.toTry.isInstanceOf[Failure[_]])  // Otherwise it complains "class Failure takes type parameters "assert(b.toTry.isInstanceOf[Failure])

2. An unknown function inside is referenced a number of times, e.g. like so:

inside(c.toTry){case Success(0) => () }

I think occurances of inside should be replaced with assertMatch

assertMatch(c.toTry){case Success(0) => ()}

But then it's probably necessary to go on and explain that to use assertMatch you have to extend TestSuite from https://github.com/lihaoyi/utest

import utest._

object XyzTests extends TestSuite {
  val tests = this {
    "pqrTest" - {
      assertMatch(b.toTry){case Success(0)=>}
    }
  }
}

3. In the following code why is a wrapped in another Rx when creating b - isn't a already a perfectly acceptable Rx?

val a = Var(1)
val b = Rx{
    (Rx{ a() }, Rx{ math.random })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant