Skip to content

Add package tests for FoundationEssentials, FoundationInternationalization, and FoundationMacros #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test-foundation-package/test-foundation-essentials.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FoundationEssentials

let data = Data([1, 2, 3])
print(data)
8 changes: 8 additions & 0 deletions test-foundation-package/test-foundation-essentials.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REQUIRES: platform=Linux
RUN: rm -rf %t
RUN: mkdir -p %t
RUN: %{swiftc} -o %t/test-foundation-essentials %S/test-foundation-essentials.swift
RUN: %t/test-foundation-essentials | %{FileCheck} %s
CHECK: bytes
LLD-NOT: libFoundation.so
LLD-NOT: libFoundationInternationalization.so
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import FoundationInternationalization

let style = IntegerFormatStyle<Int>()
print(style)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
REQUIRES: platform=Linux
RUN: rm -rf %t
RUN: mkdir -p %t
RUN: %{swiftc} -o %t/test-foundation-internationalization %S/test-foundation-internationalization.swift
RUN: %t/test-foundation-internationalization | %{FileCheck} %s
CHECK: IntegerFormatStyle
LLD-NOT: libFoundation.so
10 changes: 10 additions & 0 deletions test-foundation-package/test-foundation-macros.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FoundationEssentials

#if canImport(FoundationMacros)
#error("Should not be able to import the FoundationMacros module directly")
#endif

let predicate = #Predicate<Int> {
$0 > 2
}
print(predicate)
8 changes: 8 additions & 0 deletions test-foundation-package/test-foundation-macros.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
REQUIRES: platform=Linux
RUN: rm -rf %t
RUN: mkdir -p %t
RUN: %{swiftc} -o %t/test-foundation-macros %S/test-foundation-macros.swift
RUN: %t/test-foundation-macros | %{FileCheck} %s
CHECK: Predicate
LLD-NOT: libFoundationMacros.so
LLD-NOT: libFoundation.so