Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Li Haoyi
    @lihaoyi
    perhaps as a vararg of strings
    and then extend the command line syntax for filtering based on such tags
    vito-c
    @vito-c
    I keep getting this error
    : not found: value test
    [error]     test("test3"){
    [error]     ^
    lazy val foos = project.settings(
      moduleName := "scalafix",
        resolvers ++= Seq(
          "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
          Resolver.sonatypeRepo("releases")
        ),
      libraryDependencies ++= Seq(
        "com.lihaoyi" %% "utest" % "0.6.8" % "test"
      ),
      testFrameworks += new TestFramework("utest.runner.Framework")
    )
    vito-c
    @vito-c
    when i do :
    'test1 - {
      throw new Exception("test1")
    }
    it works as expected
    is there something i'm missing?
    scalway
    @scalway
    I guess api has changed in version 0. 7 https://mvnrepository.com/artifact/com.lihaoyi/utest. Update your dependency and use test("test3") { ... }.
    Rich
    @Rich2

    I've switched to

    "Test1" -
    { ...
    }

    Is that OK syntax to use going forward?

    vito-c
    @vito-c
    @scalway does 0.7 support 2.11 T_T
    scalway
    @scalway
    Good point. 0.7 works on 2.12+ only. Then use old notation. It is supported in 0.7 version.
    "Test" - {...} and 'Test - {...} syntax is OK and only version without minus sign
    "Test1" { ... } is deprecated now. I guess @lihaoyi just decided to create less magical syntax to be default.
    scalway
    @scalway
    Oh... sorry. "Test" - {...} notation is also deprecated in newest version. Sorry for misleading.
    vito-c
    @vito-c
    how do you run one test suite using mill and utest?
    Kasper Kondzielski
    @ghostbuster91
    @lihaoyi Hi I plan to work on diffx-utest integration. Could you give me some hints how should I inject diffx output into utest assertions? TLDR diffx does pretty diffs of arbitrary structures.
    Kasper Kondzielski
    @ghostbuster91
    Currently I did the simplest thing I could, I am throwing AssertionError manually if objects does not match without touching Tracer and Assertions macros.
    softwaremill/diffx@5bc6873
    Let me know if you have any ideas how to improve this
    Li Haoyi
    @lihaoyi
    i think the easiest way would be to store the captured objects in AssertionError, add some metadata to AssertionError so we can guess if it’s a == check or not, and then add a top level error try-catch that pattern matvhes on assertion error and prints it differently
    Reto Habluetzel
    @rethab

    Hey, I'm trying to use utest in my dotty project, which I build with mill. My build file is quite simple:

    object main extends ScalaModule {
      def scalaVersion = "0.24.0-RC1"
      object test extends Tests {
        def ivyDeps = Agg(ivy"com.lihaoyi::utest:0.7.4".withDottyCompat(scalaVersion()))
        def testFrameworks = Seq("utest.runner.Framework")
      }
    }

    When I try to run tests, however, it is complaining that Scala 2 macros cannot be used in dotty (coming from the Tests {).
    I saw that the code for Tests depends on the version of scala and I suspect that in my case the code for scala 2.13 is being pulled in rather than the one for dotty.

    How can I use utest in dotty?

    Reto Habluetzel
    @rethab
    I fixed it by manually publishing utest locally. After that, I could remove the withDottyCompat, because the suffix 0_24 now exists locally.
    Marc Grue
    @marcgrue

    Is there a way to test along the lines of this?:

    import scalatags.JsDom.all._
    import utest._
    
    object HtmlTest extends TestSuite  {
      val tests = Tests {
        test("html") {
          val page = html(body("Hello World")).render
          page.firstChild.textContent ==> "Hello World"
        }
      }
    }

    The above test gives me java.lang.Error: stub

    Christopher Hunt
    @huntc
    Hey everyone - are there any known issues when using match expressions within an eventually function? I'm using 0.6.9, but I've also tried the 0.7 releases. I see the compiler blow up:
    [error]         during phase: typer
    [error]      library version: version 2.12.10
    [error]     compiler version: version 2.12.10
    [error]   reconstructed args: ... 
    [error] 
    [error]   last tree to typer: UnApply
    [error]        tree position: line 215 of EndDeviceServiceTest.scala
    [error]               symbol: null
    [error]            call site: object EndDeviceServiceTest in package controlcenter in package controlcenter
    [error] 
    [error] == Source file context for tree position ==
    [error] 
    [error]    212             val expectedPosition = LatLng(-20, 20, None)
    [error]    213 
    [error]    214             events match {
    [error]    215               case Seq(
    [error]    216                   Snapshots.StoredEvent(
    [error]    217                     EndDeviceEvents.NameUpdated(1, "some-name")),
    [error]    218                   Snapshots.StoredEvent(EndDeviceEvents.SecretsUpdated(1, _)),
    Li Haoyi
    @lihaoyi
    yeah the macros are a bit buggy around matches
    workaround is to move it into a helper function you call
    Christopher Hunt
    @huntc
    ah right -thanks - I shall try that
    Perfect answer. Thanks @lihaoyi
    Todd O'Bryan
    @toddobryan
    I'm getting a bunch of errors in IntelliJ where it highlights the block in test("whatever") /* this part --> */{ ... } /* <-- */ with the error 'Any' does not take parameters. Everything compiles fine, and I can even run the test from IntelliJ, so I guess it's an IntelliJ bug, but is there some way to let IntelliJ know what's going on so it doesn't show an error?
    Li Haoyi
    @lihaoyi
    I see those errors too, pretty annoying :/ not sure what to do about them
    Todd O'Bryan
    @toddobryan
    Well, as long as it's not just me. :-) Is test a macro? I guess it could just be confused...
    Todd O'Bryan
    @toddobryan
    BTW, just checking to make sure, but is Li your family name, so I should call you Mr. Li or Haoyi?
    Li Haoyi
    @lihaoyi
    Li is family name
    Todd O'Bryan
    @toddobryan
    There are two IntelliJ bugs about this problem: https://youtrack.jetbrains.com/issue/SCL-17604 and https://youtrack.jetbrains.com/issue/SCL-16046. The older one, the bug went away if you removed the package declaration, but that doesn't seem to help in newer versions, so 17604 seems like it needs to be re-opened as not a duplicate.
    Marc Grue
    @marcgrue
    Seems there's conflict between utest and scalatags. Does anyone see the errors in projects without a scalatags dependency (only version 0.8.4 onwards conflict)? In this minified example project, simply uncommenting the scalatags dependency removes the utest false error (even if scalatags are not imported/used at all).
    Marc Grue
    @marcgrue
    IntelliJ told me they found the cause and that a fix is on its way...
    Yarek T
    @YarekTyshchenko
    Hi. I'm trying to run some integration tests with utest. The stack is within a Resource, and I'd like to execute it once, run all the tests inside it, then shut it down. Using IOTestSuite, can't see a way to do it, as tests is a val / whole thing is an object
    We did this with ScalaTest Async because individual tests returned F[Assertion], which could be composed
    Bruno Medeiros
    @bruno-medeiros
    Heya folks, Intellij is giving me a 'Any' does not take parameters error on utest, any idea what it could be? (running test on sbt goes just fine)
    Ben Spencer
    @dangerousben
    is there a nicer way to assert that two Lists contain the same elements (ignoring order) than just converting them to Sets?
    Minghao Liu
    @molikto
    how can I use snapshot version for Dotty new version?
    jodersky
    @jodersky
    You'll need to build utest yourself if it isn't published for the version of dotty you're looking for
    ./mill -i -D dottyVersion="<version>" utest.jvm[<version>].publishLocal
    it might also be worth checking out if there are any outstanding fixes in the dotty community build version of utest https://github.com/dotty-staging/utest
    Jiuyang Liu
    @sequencer
    I'm using mill with utest, but it can only test with a single thread? is there any methods to make mill run utest in parallel?
    Dave Smith
    @davesmith00000
    @jodersky I had a go at following your instructions above and building for 3.0.0-M1 from dotty-staging (for use with Scala.js) but to no avail. Any idea if there's a build on the horizon by any chance?
    Tobias Roeser
    @lefou
    Hi. I try to refactor an existing test suite, but it looks like there is no way to move the test("xx") - .. stuff into a helper method or a for loop. I'd like to create test cases in a matrix. Can you tell me please if I overlooked something?
    I always hit the test - method should only be used directly inside a Tests{} macro error.
    Tobias Roeser
    @lefou
    @lihaoyi could you comment?
    Li Haoyi
    @lihaoyi
    @lefou utest doesnt have good built in support for that kind of thing. If your matrix is small, you can use an abstract test suite that multiple suites inherit from. Or you could move the test logic into a helper and spell out all the permutations as separate tests. Neither are ideal, but it is what it is
    Tobias Roeser
    @lefou
    Got it, thank you
    Tobias Roeser
    @lefou
    Does uTest support pending / skipping tests or the concept of assumptions as a precondition to run/skip a test?
    Li Haoyi
    @lihaoyi
    not explicitly as features; we've been commenting our tests or wrapping their bodies in if statements as workarounds
    Tobias Roeser
    @lefou
    Ok. But this has the downside, that skipped tests are not counted and won't appear in any reports/statistics. Other frameworks have this, e.g. Junit, Testng, Scalatest, ...