Skip to content

Commit 7b48faa

Browse files
authored
Add package tests for FoundationEssentials, FoundationInternationalization, and FoundationMacros (#149)
* Add package tests for FoundationEssentials, FoundationInternationalization, and FoundationMacros * Fix i18n package test
1 parent e780555 commit 7b48faa

6 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import FoundationEssentials
2+
3+
let data = Data([1, 2, 3])
4+
print(data)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -o %t/test-foundation-essentials %S/test-foundation-essentials.swift
5+
RUN: %t/test-foundation-essentials | %{FileCheck} %s
6+
CHECK: bytes
7+
LLD-NOT: libFoundation.so
8+
LLD-NOT: libFoundationInternationalization.so
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import FoundationInternationalization
2+
3+
let style = IntegerFormatStyle<Int>()
4+
print(style)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -o %t/test-foundation-internationalization %S/test-foundation-internationalization.swift
5+
RUN: %t/test-foundation-internationalization | %{FileCheck} %s
6+
CHECK: IntegerFormatStyle
7+
LLD-NOT: libFoundation.so
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import FoundationEssentials
2+
3+
#if canImport(FoundationMacros)
4+
#error("Should not be able to import the FoundationMacros module directly")
5+
#endif
6+
7+
let predicate = #Predicate<Int> {
8+
$0 > 2
9+
}
10+
print(predicate)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -o %t/test-foundation-macros %S/test-foundation-macros.swift
5+
RUN: %t/test-foundation-macros | %{FileCheck} %s
6+
CHECK: Predicate
7+
LLD-NOT: libFoundationMacros.so
8+
LLD-NOT: libFoundation.so

0 commit comments

Comments
 (0)