mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[6.2.1] Add Equatable and Hashable conformance to GUID.
This commit is contained in:
22
test/stdlib/WinSDK_GUID.swift
Normal file
22
test/stdlib/WinSDK_GUID.swift
Normal file
@@ -0,0 +1,22 @@
|
||||
// RUN: %target-build-swift %s -o %t.exe
|
||||
// RUN: %target-codesign %t.exe
|
||||
// RUN: %target-run %t.exe
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: OS=windows-msvc
|
||||
|
||||
// Make sure that importing WinSDK brings in the GUID type, which is declared in
|
||||
// /shared and not in /um.
|
||||
|
||||
import WinSDK
|
||||
|
||||
public func usesGUID(_ x: GUID) {}
|
||||
|
||||
// Make sure equating and hashing GUIDs works.
|
||||
|
||||
let guid: GUID = GUID_NULL
|
||||
assert(guid == guid)
|
||||
assert(guid.hashValue == guid.hashValue)
|
||||
|
||||
let guid2: GUID = IID_IUnknown
|
||||
assert(guid != guid2)
|
||||
assert(guid.hashValue != guid2.hashValue) // well, probably
|
||||
Reference in New Issue
Block a user