lit: flesh out `SubsituteCaptures` further
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 3 May 2018 04:45:43 +0000 (04:45 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 3 May 2018 04:45:43 +0000 (04:45 +0000)
Add overloads for `__len__` and `__getitem__` to allow use of this class
on Linux as well as Windows.  With these overloads, lit can be used on
both hosts for the swift testsuite.

llvm-svn: 331431

llvm/utils/lit/lit/TestingConfig.py

index 713baa6..3167974 100644 (file)
@@ -171,3 +171,9 @@ class SubstituteCaptures:
     def __str__(self):
         return self.substitution
 
+    def __len__(self):
+        return len(self.substitution)
+
+    def __getitem__(self, item):
+        return self.substitution.__getitem__(item)
+