Skip to content

Commit a11756b

Browse files
authored
Merge pull request github#11542 from github/alexdenisov/canonical-case
Swift: add a test case showing case canonicalization
2 parents c4cb410 + f5ddbd6 commit a11756b

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
lines changed

swift/extractor/infra/Path.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ static bool shouldCanonicalize() {
1717
}
1818

1919
std::filesystem::path getCodeQLPath(std::string_view path) {
20-
// TODO: this needs more testing
21-
// TODO: check canonicalization of names on a case insensitive filesystems
2220
std::error_code ec;
2321
std::filesystem::path ret = {};
2422
static const auto canonicalize = shouldCanonicalize();
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
| MiXeDcAsE.swifT:0:0:0:0 | MiXeDcAsE.swifT |
2+
| file://:0:0:0:0 | |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import swift
2+
3+
from File f
4+
select f

swift/integration-tests/osx-only/canonical-case/MiXeDcAsE.swifT

Whitespace-only changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SDK="-sdk $(xcrun -show-sdk-path)"
4+
FRONTEND="$(xcrun -find swift-frontend)"
5+
6+
# This test case will only work on a case-insensitive FS (which is the default)
7+
$FRONTEND -frontend -c MIXEDCASE.swift $SDK
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from create_database_utils import *
2+
3+
run_codeql_database_create([
4+
'./build.sh',
5+
], lang='swift')

0 commit comments

Comments
 (0)