From fdd23f4378c527667a1779c17fc9d2ad190d04dc Mon Sep 17 00:00:00 2001 From: Thibaut Schmitt Date: Wed, 21 Jan 2026 15:20:08 +0100 Subject: [PATCH] Fixing tests again --- .../Generated/Analytics+GenAllScript.swift | 2 +- .../Analytics/Generator/MatomoGenerator.swift | 2 +- .../Analytics/AnalyticsGeneratorTests.swift | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SampleFiles/Tags/Generated/Analytics+GenAllScript.swift b/SampleFiles/Tags/Generated/Analytics+GenAllScript.swift index f130e3b..3b4c4aa 100644 --- a/SampleFiles/Tags/Generated/Analytics+GenAllScript.swift +++ b/SampleFiles/Tags/Generated/Analytics+GenAllScript.swift @@ -64,7 +64,7 @@ class MatomoAnalyticsManager: AnalyticsManagerProtocol { ) { guard let trackerUrl = tracker.contentBase?.absoluteString else { return } - let urlString = URL(string: "\(trackerUrl)" + "/" + "\(path)" + "yolo" + let urlString = URL(string: "\(trackerUrl)" + "/" + "\(path)" + "/yolo") tracker.track( view: [name], url: urlString diff --git a/Sources/ResgenSwift/Analytics/Generator/MatomoGenerator.swift b/Sources/ResgenSwift/Analytics/Generator/MatomoGenerator.swift index 9aad1ca..63af4b0 100644 --- a/Sources/ResgenSwift/Analytics/Generator/MatomoGenerator.swift +++ b/Sources/ResgenSwift/Analytics/Generator/MatomoGenerator.swift @@ -82,7 +82,7 @@ enum MatomoGenerator { ) { guard let trackerUrl = tracker.contentBase?.absoluteString else { return } - let urlString = URL(string: "\\(trackerUrl)" + "/" + "\\(path)"\(pathSuffixCode) + let urlString = URL(string: "\\(trackerUrl)" + "/" + "\\(path)"\(pathSuffixCode)) tracker.track( view: [name], url: urlString diff --git a/Tests/ResgenSwiftTests/Analytics/AnalyticsGeneratorTests.swift b/Tests/ResgenSwiftTests/Analytics/AnalyticsGeneratorTests.swift index b1da6f8..71e83fa 100644 --- a/Tests/ResgenSwiftTests/Analytics/AnalyticsGeneratorTests.swift +++ b/Tests/ResgenSwiftTests/Analytics/AnalyticsGeneratorTests.swift @@ -179,7 +179,7 @@ final class AnalyticsGeneratorTests: XCTestCase { ) { guard let trackerUrl = tracker.contentBase?.absoluteString else { return } - let urlString = URL(string: "\\(trackerUrl)" + "/" + "\\(path)" + "iOS") + let urlString = URL(string: "\\(trackerUrl)" + "/" + "\\(path)" + "/iOS") tracker.track( view: [name], url: urlString @@ -427,19 +427,19 @@ final class AnalyticsGeneratorTests: XCTestCase { // Given let sectionOne = AnalyticsCategory(id: "section_one") sectionOne.definitions = [ - getAnalyticsDefinition(id: "s1_def_one", path: "s1_def_one/", name: "s1 def one", type: .screen, tags: ["ios", "iosonly"]), + getAnalyticsDefinition(id: "s1_def_one", path: "s1_def_one", name: "s1 def one", type: .screen, tags: ["ios", "iosonly"]), getAnalyticsDefinition(id: "s1_def_two", action: "test", category: "test", name: "s1 def two", type: .event, tags: ["ios", "iosonly"]), ] let sectionTwo = AnalyticsCategory(id: "section_two") sectionTwo.definitions = [ - getAnalyticsDefinition(id: "s2_def_one", path: "s2_def_one/", name: "s2 def one", type: .screen, tags: ["ios","iosonly"]), + getAnalyticsDefinition(id: "s2_def_one", path: "s2_def_one", name: "s2 def one", type: .screen, tags: ["ios","iosonly"]), getAnalyticsDefinition(id: "s2_def_two", action: "test", category: "test", name: "s2 def two", type: .event, tags: ["droid","droidonly"]), ] let sectionThree = AnalyticsCategory(id: "section_three") sectionThree.definitions = [ - getAnalyticsDefinition(id: "s3_def_one", path: "s3_def_one/", name: "s3 def one", type: .screen, tags: ["droid","droidonly"]), + getAnalyticsDefinition(id: "s3_def_one", path: "s3_def_one", name: "s3 def one", type: .screen, tags: ["droid","droidonly"]), getAnalyticsDefinition(id: "s3_def_two", action: "test", category: "test", name: "s3 def two", type: .event, tags: ["droid","droidonly"]), ] @@ -607,7 +607,7 @@ final class AnalyticsGeneratorTests: XCTestCase { internal func logScreenS1DefOne() { logScreen( name: "s1 def one", - path: "s1_def_one/", + path: "s1_def_one", params: nil ) } @@ -626,7 +626,7 @@ final class AnalyticsGeneratorTests: XCTestCase { internal func logScreenS2DefOne() { logScreen( name: "s2 def one", - path: "s2_def_one/", + path: "s2_def_one", params: nil ) } @@ -644,19 +644,19 @@ final class AnalyticsGeneratorTests: XCTestCase { // Given let sectionOne = AnalyticsCategory(id: "section_one") sectionOne.definitions = [ - getAnalyticsDefinition(id: "s1_def_one", path: "s1_def_one/", name: "s1 def one", type: .screen, tags: ["ios", "iosonly"]), + getAnalyticsDefinition(id: "s1_def_one", path: "s1_def_one", name: "s1 def one", type: .screen, tags: ["ios", "iosonly"]), getAnalyticsDefinition(id: "s1_def_two", action: "test", category: "test", name: "s1 def two", type: .event, tags: ["ios", "iosonly"]), ] let sectionTwo = AnalyticsCategory(id: "section_two") sectionTwo.definitions = [ - getAnalyticsDefinition(id: "s2_def_one", path: "s2_def_one/", name: "s2 def one", type: .screen, tags: ["ios","iosonly"]), + getAnalyticsDefinition(id: "s2_def_one", path: "s2_def_one", name: "s2 def one", type: .screen, tags: ["ios","iosonly"]), getAnalyticsDefinition(id: "s2_def_two", action: "test", category: "test", name: "s2 def two", type: .event, tags: ["droid","droidonly"]), ] let sectionThree = AnalyticsCategory(id: "section_three") sectionThree.definitions = [ - getAnalyticsDefinition(id: "s3_def_one", path: "s3_def_one/", name: "s3 def one", type: .screen, tags: ["droid","droidonly"]), + getAnalyticsDefinition(id: "s3_def_one", path: "s3_def_one", name: "s3 def one", type: .screen, tags: ["droid","droidonly"]), getAnalyticsDefinition(id: "s3_def_two", action: "test", category: "test", name: "s3 def two", type: .event, tags: ["droid","droidonly"]), ]