           if #available(SwiftStdlib 5.7, *) {
             let substring = string[i ..< j]
             expectEqual(
-              substring.index(substring.startIndex, offsetBy: characterDistance),
+              substring.index(substring.startIndex, offsetBy: substringDistance),
               substring.endIndex,
               """
               string:   \(string.debugDescription)

    }
    var i = other.startIndex
    var j = self.startIndex
    while i != other.endIndex {
      let current = i
      other.formIndex(after: &i)

              distance: \(characterDistance)
              """)
            expectEqual(
              substring.index(substring.endIndex, offsetBy: -substringDistance),
              substring.startIndex,
              """
              string:   \(string.debugDescription)
