Skip to content

Commit

Permalink
chore: cleanup un-implemented tests and make build client code
Browse files Browse the repository at this point in the history
  • Loading branch information
EnesKaraosman committed Mar 28, 2024
1 parent 4c3f48b commit ca11fb5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
37 changes: 20 additions & 17 deletions Sources/LoremSwiftifyClient/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,25 @@ import Foundation
import LoremSwiftify

@LoremSwiftify
struct Person {
let name: String
let surname: String
var title: String = "DefaultTitle"
let age: Int
var isAdult = true
}

@LoremSwiftify
struct Book {
class Book {
let name: String
let published: Date
let author: Author

init(name: String, published: Date, author: Author) {
self.name = name
self.published = published
self.author = author
}

@LoremSwiftify
struct Author {
class Author {
let name: String
let surname: String
var nickName: String?
let age: Int

init(name: String, surname: String, nickName: String? = nil, age: Int) {
init(_ name: String, surname: String, nickName: String? = nil, age: Int) {
self.name = name
self.surname = surname
self.nickName = nickName
Expand All @@ -32,6 +29,8 @@ struct Book {
}
}

print(Book.lorem())

@LoremSwiftify
struct Hotel {
let name: String
Expand All @@ -40,12 +39,16 @@ struct Hotel {
@LoremSwiftify
struct Room {
let id: UUID
let capacity: Int
let capacity: Capacity

@LoremSwiftify
enum Capacity: Int {
case one = 1
case two = 2
case three = 3
case four = 4
}
}
}

print(Person.lorem())
print(Author.lorem())
print(Book.lorem())
print(User.lorem())
print(Hotel.lorem())
19 changes: 1 addition & 18 deletions Tests/LoremSwiftsumizeTests/LoremSwiftsumizeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,5 @@ import MacroTesting
import XCTest

final class LoremSwiftifyTests: MacroTestCase {
func testUnsupportedDeclSyntaxMacro() throws {
assertMacro {
"""
@LoremSwiftify
struct User {
let name: String
}
"""
} expansion: {
"""
extension User: LoremIpsumize {
static func lorem() -> Self {
return User(name: "lorem")
}
}
"""
}
}

}
2 changes: 0 additions & 2 deletions Tests/LoremSwiftsumizeTests/TestUtils/MacroTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// MockableMacroTestCase.swift
//
//
// Created by Kolos Foltanyi on 2023. 11. 21..
//

import Foundation
import SwiftSyntaxMacros
Expand Down

0 comments on commit ca11fb5

Please sign in to comment.