Skip to content

Commit

Permalink
Re-enabled the commentted DirectDiagrammedAssertionsSpec.scala.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseng committed Dec 29, 2022
1 parent 90356ce commit 9fffb01
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
Expand Up @@ -23,9 +23,11 @@ import org.scalatest.exceptions.TestFailedException
import org.scalatest.funspec.AnyFunSpec
import org.scalatest.matchers.should.Matchers

// SKIP-SCALATESTJS,NATIVE-START
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.{Duration, SECONDS}
import scala.concurrent.{Await, Future}
// SKIP-SCALATESTJS,NATIVE-END

class DiagramsSpec extends AnyFunSpec with Matchers with Diagrams {

Expand Down
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*package org.scalatest.diagrams
package org.scalatest.diagrams

import org.scalatest.SharedHelpers.thisLineNumber
import java.util.Date
Expand All @@ -22,6 +22,12 @@ import org.scalatest.exceptions.TestCanceledException
import org.scalatest.exceptions.TestFailedException
import org.scalatest.funspec.AnyFunSpec

// SKIP-SCALATESTJS,NATIVE-START
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.{Duration, SECONDS}
import scala.concurrent.{Await, Future}
// SKIP-SCALATESTJS,NATIVE-END

class DirectDiagrammedAssertionsSpec extends AnyFunSpec with org.scalatest.matchers.should.Matchers {

val fileName: String = "DirectDiagrammedAssertionsSpec.scala"
Expand Down Expand Up @@ -2584,6 +2590,15 @@ class DirectDiagrammedAssertionsSpec extends AnyFunSpec with org.scalatest.match
|org.scalatest.diagrams.Diagrams.assert(java.math.BigInteger.ZERO == java.math.BigInteger.ZERO)
""".stripMargin)
}

// scala js and native does not support Await.result
// SKIP-SCALATESTJS,NATIVE-START
it("should invoke future one time only") {
var count = 0
org.scalatest.diagrams.Diagrams.assert(Await.result(Future { count = count + 1; 42 }, Duration(1, SECONDS)) == 42)
count shouldBe 1
}
// SKIP-SCALATESTJS,NATIVE-END
}

describe("The org.scalatest.diagrams.Diagrams.assert(boolean, clue) method") {
Expand Down Expand Up @@ -5042,6 +5057,15 @@ class DirectDiagrammedAssertionsSpec extends AnyFunSpec with org.scalatest.match
|org.scalatest.diagrams.Diagrams.assert(java.math.BigDecimal.ZERO == java.math.BigDecimal.ZERO, "this is a clue")
""".stripMargin)
}

// scala js and native does not support Await.result
// SKIP-SCALATESTJS,NATIVE-START
it("should invoke future one time only") {
var count = 0
org.scalatest.diagrams.Diagrams.assert(Await.result(Future { count = count + 1; 42 }, Duration(1, SECONDS)) == 42, "this is a clue")
count shouldBe 1
}
// SKIP-SCALATESTJS,NATIVE-END
}

describe("The org.scalatest.diagrams.Diagrams.assume(boolean) method") {
Expand Down Expand Up @@ -7500,6 +7524,15 @@ class DirectDiagrammedAssertionsSpec extends AnyFunSpec with org.scalatest.match
|org.scalatest.diagrams.Diagrams.assume(java.math.BigDecimal.ZERO == java.math.BigDecimal.ZERO)
""".stripMargin)
}

// scala js and native does not support Await.result
// SKIP-SCALATESTJS,NATIVE-START
it("should invoke future one time only") {
var count = 0
org.scalatest.diagrams.Diagrams.assume(Await.result(Future { count = count + 1; 42 }, Duration(1, SECONDS)) == 42)
count shouldBe 1
}
// SKIP-SCALATESTJS,NATIVE-END
}

describe("The org.scalatest.diagrams.Diagrams.assume(boolean, clue) method") {
Expand Down Expand Up @@ -9958,9 +9991,18 @@ class DirectDiagrammedAssertionsSpec extends AnyFunSpec with org.scalatest.match
|org.scalatest.diagrams.Diagrams.assume(java.math.BigDecimal.ZERO == java.math.BigDecimal.ZERO, "this is a clue")
""".stripMargin)
}

// scala js and native does not support Await.result
// SKIP-SCALATESTJS,NATIVE-START
it("should invoke future one time only") {
var count = 0
org.scalatest.diagrams.Diagrams.assume(Await.result(Future { count = count + 1; 42 }, Duration(1, SECONDS)) == 42, "this is a clue")
count shouldBe 1
}
// SKIP-SCALATESTJS,NATIVE-END
}

}

}*/
}

0 comments on commit 9fffb01

Please sign in to comment.