---
title: fileName
framework: testing
role: symbol
role_heading: Instance Property
path: testing/sourcelocation/filename
---

# fileName

The name of the source file.

## Declaration

```swift
var fileName: String { get }
```

## Discussion

Discussion The name of the source file is derived from this instance’s fileID property. It consists of the substring of the file ID after the last forward-slash character ("/".) For example, if the value of this instance’s fileID property is "FoodTruck/WheelTests.swift", the file name is "WheelTests.swift". The structure of file IDs is described in the documentation for #fileID in the Swift standard library.

## See Also

### Related Documentation

- [fileID](testing/sourcelocation/fileid.md)
- [moduleName](testing/sourcelocation/modulename.md)
