These are chat archives for etorreborre/specs2

21st
Jun 2018
Keir Lawson
@keirlawson
Jun 21 2018 10:14
When trying to generate the user guide locally I'm getting org.scalajs.core.tools.linker.LinkingException: There were linking errors
scrolling up the only error I see is:
[info] Fast optimizing /home/keir/Code/specs2/target/scala-2.12/specs2-test-fastopt.js
[error] Fatal error: java.lang.Object is missing
[error]   called from core module analyzer
any idea what the issue might be?
(I'm on the latest master)
Eric Torreborre
@etorreborre
Jun 21 2018 11:31
If I remember correctly you need to go to the guide submodule to start the generation
Keir Lawson
@keirlawson
Jun 21 2018 11:32
ok, I'll try that
Eric Torreborre
@etorreborre
Jun 21 2018 11:33
This is not something I do often enough so I get also mixed up
Keir Lawson
@keirlawson
Jun 21 2018 11:35
running it within the guide folder I get
[error] /home/keir/Code/specs2/guide/src/test/scala/org/specs2/guide/UseForms.scala:98:136: To compile XML syntax, the scala.xml package must be on the classpath.
[error] Please see https://github.com/scala/scala-xml for details.
[error]   tr(field("field(\"label\", \"value\").decorateWith(f: Any => <em>{f}</em>)").code, field("label", "value").decorateWith((ns: Any) => <em>{ns}</em>)).
[error]                                                                                                                                        ^
[error] one error found
Eric Torreborre
@etorreborre
Jun 21 2018 11:37
let me try right now
Keir Lawson
@keirlawson
Jun 21 2018 11:37
thanks :)
That linking error I got when running it in the main project I also get when just running sbt test
my colleague says she is getting the same on her machine as well
Eric Torreborre
@etorreborre
Jun 21 2018 11:39
guide> testOnly *Website* works ok for me
sbt test is indeed not working
because it is trying to run some tests as ScalaJs and that won’t work
If you look at the travis file you will see that I’m running the following:
  - ./.travis-test.sh coreJVM
  - ./.travis-test.sh tests

  - ./.travis-test.sh examplesJVM
  - ./.travis-test.sh junitJVM
  - ./.travis-test.sh matcherExtraJVM
  - ./.travis-test.sh mockJVM
  - ./.travis-test.sh scalacheckJVM
  - ./.travis-test.sh scalazJVM
  - ./.travis-test.sh shapelessJVM

  - ./.travis-test.sh gwt
  - ./.travis-test.sh html
  - ./.travis-test.sh markdown
  - ./.travis-test.sh tests

  - ./.travis-test.sh coreJS
  - ./.travis-test.sh examplesJS
I haven’t spent yet the time to tweak the build.sbt so that sbt test would do that but PRs are welcome!
Keir Lawson
@keirlawson
Jun 21 2018 11:46
ok, will see how far I get with my current attempt at a PR :D
Eric Torreborre
@etorreborre
Jun 21 2018 11:46
all good :-)
Keir Lawson
@keirlawson
Jun 21 2018 11:47
I'm looking at adding support for Cats' NonEmptyList btw, but as it doesn't implement Traversable it looks like its going to be a bit tricky (expect for the sizing ones as implementing Sized is straightforward)
Any thoughts on what would be the best approach?
Eric Torreborre
@etorreborre
Jun 21 2018 11:57

My biggest concern might be name overloading. Can you try to make something like ContainWithResult[T] a bit more generic for example

case class ContainWithResult[M[T] : IsIterable, T](…) extends Matcher[M[T]]

trait IsIterable[M[_]] {
   def makeIterable[T](mt: M[T]): Iterable[T]
}

And create an instance of IsIterable for NonEmptyList. Then the big question is how type inference is going to behave for the existing code

Keir Lawson
@keirlawson
Jun 21 2018 11:57
ok, I'll give that a bash
Eric Torreborre
@etorreborre
Jun 21 2018 11:58
good luck :-)
Keir Lawson
@keirlawson
Jun 21 2018 11:58
would you accept a PR just for the Sizedimpl on its own (before I work on the rest) or is that too little value in isolation?
Eric Torreborre
@etorreborre
Jun 21 2018 11:59
Go for it
Keir Lawson
@keirlawson
Jun 21 2018 11:59
:)
Keir Lawson
@keirlawson
Jun 21 2018 14:48
Is it just me or is https://github.com/etorreborre/specs2/blob/master/matcher/shared/src/main/scala/org/specs2/matcher/TraversableMatchers.scala#L34 not used anywhere? I tried commenting it out and the tests still passed, but maybe there is some subtlety I am missing?
Eric Torreborre
@etorreborre
Jun 21 2018 15:03
Fairly possible, let’s remove it then
Keir Lawson
@keirlawson
Jun 21 2018 15:03
:+1: