mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
libstdc++ currently cannot be split into submodules due to the way some types are defined, e.g. there are multiple headers that define `size_t`, so those headers must be a single (sub-)module.
26 lines
528 B
Swift
26 lines
528 B
Swift
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop)
|
|
//
|
|
// REQUIRES: executable_test
|
|
|
|
import StdlibUnittest
|
|
import StdString
|
|
import CxxStdlib
|
|
|
|
var StdStringTestSuite = TestSuite("StdString")
|
|
|
|
StdStringTestSuite.test("init") {
|
|
let s = CxxString()
|
|
expectEqual(s.size(), 0)
|
|
expectTrue(s.empty())
|
|
}
|
|
|
|
StdStringTestSuite.test("push back") {
|
|
var s = CxxString()
|
|
s.push_back(42)
|
|
expectEqual(s.size(), 1)
|
|
expectFalse(s.empty())
|
|
expectEqual(s[0], 42)
|
|
}
|
|
|
|
runAllTests()
|