Skip to content

Commit d6ab168

Browse files
authored
Merge pull request #5 from typelevel/char-classes
Introduce XML 1.0 4th Ed classes, union with scala-xml
2 parents 090755b + 97164e1 commit d6ab168

File tree

6 files changed

+548
-478
lines changed

6 files changed

+548
-478
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ jobs:
9494

9595
- name: Make target directories
9696
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
97-
run: mkdir -p target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
97+
run: mkdir -p target .js/target core/native/target site/target core/js/target core/jvm/target .jvm/target .native/target project/target
9898

9999
- name: Compress target directories
100100
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
101-
run: tar cf targets.tar target .js/target core/.native/target site/target core/.js/target core/.jvm/target .jvm/target .native/target project/target
101+
run: tar cf targets.tar target .js/target core/native/target site/target core/js/target core/jvm/target .jvm/target .native/target project/target
102102

103103
- name: Upload target directories
104104
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ThisBuild / scalaVersion := Scala213 // the default Scala
2323
lazy val root = tlCrossRootProject.aggregate(core)
2424

2525
lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform)
26-
.crossType(CrossType.Pure)
26+
.crossType(CrossType.Full)
2727
.in(file("core"))
2828
.settings(
2929
name := "scalacheck-xml",
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright 2022 Typelevel
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.typelevel.scalacheck.xml
18+
19+
import org.scalacheck.Prop
20+
import org.scalacheck.Properties
21+
22+
import java.io.StringWriter
23+
import java.nio.charset.StandardCharsets
24+
import scala.xml.XML
25+
26+
class RoundTripCheck extends Properties("RoundTripCheck") {
27+
28+
property("genXml round trips") = Prop.forAll(generators.genXml) { node =>
29+
val sw = new StringWriter
30+
XML.write(sw, node, StandardCharsets.UTF_8.name, true, null)
31+
val s = sw.toString
32+
val node2 = XML.loadString(s)
33+
node == node2
34+
}
35+
36+
}

0 commit comments

Comments
 (0)