Skip to content

Commit

Permalink
Bump AttributedText dependency (#150)
Browse files Browse the repository at this point in the history
* Bump AttributedText dependency

* Update snapshots

* Update workflows

* Bump SnapshotTesting dependency

* Update Makefile

* Adjust perceptual precision for flaky test
  • Loading branch information
Guille Gonzalez authored Oct 29, 2022
1 parent 6a33c60 commit 3c80d50
Show file tree
Hide file tree
Showing 39 changed files with 21 additions and 109 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Select Xcode 13.4.1
run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- name: Select Xcode 14.1
run: sudo xcode-select -s /Applications/Xcode_14.1.app
- name: Run tests
run: make test
6 changes: 3 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- name: Select Xcode 13.4.1
run: sudo xcode-select -s /Applications/Xcode_13.4.1.app
- name: Select Xcode 14.1
run: sudo xcode-select -s /Applications/Xcode_14.1.app
- name: Tap
run: brew tap pointfreeco/formulae
- name: Install
run: brew install Formulae/swift-format@5.6
run: brew install Formulae/swift-format@5.7
- name: Format
run: make format
- uses: stefanzweifel/git-auto-commit-action@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/gonzalezreal/AttributedText",
"state": {
"branch": null,
"revision": "2dc2d7864e0fee4b524a5850d7d7cf9a7eeda0fc",
"version": "1.0.0"
"revision": "0e811cb14de367bbd58a94d12259687e5ee08bea",
"version": "1.0.1"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test-macos:
test-ios:
xcodebuild test \
-scheme MarkdownUI \
-destination platform="iOS Simulator,name=iPhone 8"
-destination platform="iOS Simulator,name=iPhone SE (3rd generation)"

test-tvos:
xcodebuild test \
Expand All @@ -18,7 +18,7 @@ readme-images:
xcodebuild test \
"OTHER_SWIFT_FLAGS=${inherited} -D README_IMAGES" \
-scheme MarkdownUI \
-destination platform="iOS Simulator,name=iPhone 8" \
-destination platform="iOS Simulator,name=iPhone SE (3rd generation)" \
-only-testing "MarkdownUITests/ReadMeImagesTests" || true
mv Tests/MarkdownUITests/__Snapshots__/ReadMeImagesTests Images
sips -Z 400 Images/*.png
Expand Down
10 changes: 5 additions & 5 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/gonzalezreal/AttributedText",
"state": {
"branch": null,
"revision": "2dc2d7864e0fee4b524a5850d7d7cf9a7eeda0fc",
"version": "1.0.0"
"revision": "0e811cb14de367bbd58a94d12259687e5ee08bea",
"version": "1.0.1"
}
},
{
Expand All @@ -29,12 +29,12 @@
}
},
{
"package": "SnapshotTesting",
"package": "swift-snapshot-testing",
"repositoryURL": "https://github.com/pointfreeco/swift-snapshot-testing",
"state": {
"branch": null,
"revision": "f8a9c997c3c1dab4e216a8ec9014e23144cbab37",
"version": "1.9.0"
"revision": "f29e2014f6230cf7d5138fc899da51c7f513d467",
"version": "1.10.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let package = Package(
.package(
name: "AttributedText",
url: "https://github.com/gonzalezreal/AttributedText",
from: "1.0.0"
from: "1.0.1"
),
.package(
name: "NetworkImage",
Expand All @@ -35,7 +35,7 @@ let package = Package(
.package(
name: "SnapshotTesting",
url: "https://github.com/pointfreeco/swift-snapshot-testing",
from: "1.9.0"
from: "1.10.0"
),
],
targets: [
Expand Down
98 changes: 5 additions & 93 deletions Tests/MarkdownUITests/MarkdownTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,45 +109,6 @@
assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
}

func testRightToLeftList() {
let view = Markdown(
#"""
This is an incomplete list of headgear:
1. Hats
1. Caps
1. Bonnets
Some more:
10. Helmets
1. Hoods
1. Headbands, headscarves, wimples
Headgear organised by function:
- Religious
- Military and police
A list with a high start:
100000. See also
There is also a list of hat styles like:
- Ascot cap
- Akubra
1. References
― From Wikipedia, the free encyclopedia
"""#
)
.environment(\.layoutDirection, .rightToLeft)
.background(Color.orange)
.padding()

assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
}

func testHeadingsAndBlockQuotesInsideList() {
let view = Markdown(
#"""
Expand Down Expand Up @@ -371,59 +332,6 @@
assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
}

func testThematicBreak() {
let view = Markdown(
#"""
# SwiftUI
Declare the user interface and behavior for your app
on every platform.
---
## Overview
SwiftUI provides views, controls, and layout structures
for declaring your app’s user interface.
---
― From Apple Developer Documentation
"""#
)
.background(Color.orange)
.padding()

assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
}

func testThematicBreakAndCenterAlignment() {
let view = Markdown(
#"""
# SwiftUI
Declare the user interface and behavior for your app
on every platform.
---
## Overview
SwiftUI provides views, controls, and layout structures
for declaring your app’s user interface.
---
― From Apple Developer Documentation
"""#
)
.multilineTextAlignment(.center)
.background(Color.orange)
.padding()

assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
}

func testInlines() {
let view = Markdown(
#"""
Expand All @@ -449,7 +357,11 @@
.background(Color.orange)
.padding()

assertSnapshot(matching: view, as: .image(layout: layout), named: platformName)
assertSnapshot(
matching: view,
as: .image(perceptualPrecision: 0.98, layout: layout),
named: platformName
)
}

func testMarkdownStyle() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit 3c80d50

Please sign in to comment.