"""Test that we can correctly handle a nested generic type."""

import lldbsuite.test.lldbrepl as lldbrepl
import lldbsuite.test.decorators as decorators


class REPLBasicTestCase(lldbrepl.REPLTest):

    mydir = lldbrepl.REPLTest.compute_mydir(__file__)
    @decorators.expectedFailureAll(
        oslist=[
            "macosx",
            "linux"],
        bugnumber="rdar://35264910")
    def doTest(self):
        self.command(
            '''class Foo<T,U> {
           var t: T?
           var u: U?
           init() { t = nil; u = nil }
           init(_ x: T, _ y: U) { t = x; u = y }
        };(Foo<String,Double>(),Foo<Double,String>(3.14,"hello"))''',
            patterns=[
                r'\$R0: \(Foo<String, Double>, Foo<Double, String>\) = {',
                r'0 = {',
                r't = nil',
                r'u = nil',
                r'1 = {',
                r't = 3\.14[0-9]+', 'u = "hello"'])

"""Test that we can correctly handle a nested generic type."""

import lldbsuite.test.lldbrepl as lldbrepl
import lldbsuite.test.decorators as decorators


class REPLBasicTestCase(lldbrepl.REPLTest):

    mydir = lldbrepl.REPLTest.compute_mydir(__file__)

    def doTest(self):
        self.command(
            '''class Foo<T,U> {
           var t: T?
           var u: U?
           init() { t = nil; u = nil }
           init(_ x: T, _ y: U) { t = x; u = y }
        };(Foo<String,Double>(),Foo<Double,String>(3.14,"hello"))''',
            patterns=[
                r'\$R0: \(Foo<String, Double>, Foo<Double, String>\) = {',
                r'0 = {',
                r't = nil',
                r'u = nil',
                r'1 = {',
                r't = 3\.14[0-9]+', 'u = "hello"'])

Revert "Disable test that fails on bot"
Revert "Disable test that fails on bot"

This reverts commit e214e46e748881e6418ffac374a87d6ad30fcfea.

I have reverted the swift commit that was causing this failure.

rdar://35264910

  """Test that we can correctly handle a nested generic type."""
  
  import lldbsuite.test.lldbrepl as lldbrepl
  import lldbsuite.test.decorators as decorators
  
  
  class REPLBasicTestCase(lldbrepl.REPLTest):
  
      mydir = lldbrepl.REPLTest.compute_mydir(__file__)
+ 
-     @decorators.expectedFailureAll(
-         oslist=[
-             "macosx",
-             "linux"],
-         bugnumber="rdar://35264910")
      def doTest(self):
          self.command(
              '''class Foo<T,U> {
             var t: T?
             var u: U?
             init() { t = nil; u = nil }
             init(_ x: T, _ y: U) { t = x; u = y }
          };(Foo<String,Double>(),Foo<Double,String>(3.14,"hello"))''',
              patterns=[
                  r'\$R0: \(Foo<String, Double>, Foo<Double, String>\) = {',
                  r'0 = {',
                  r't = nil',
                  r'u = nil',
                  r'1 = {',
                  r't = 3\.14[0-9]+', 'u = "hello"'])
  
Revert "Disable test that fails on bot"
## Code Before:
"""Test that we can correctly handle a nested generic type."""

import lldbsuite.test.lldbrepl as lldbrepl
import lldbsuite.test.decorators as decorators


class REPLBasicTestCase(lldbrepl.REPLTest):

    mydir = lldbrepl.REPLTest.compute_mydir(__file__)
    @decorators.expectedFailureAll(
        oslist=[
            "macosx",
            "linux"],
        bugnumber="rdar://35264910")
    def doTest(self):
        self.command(
            '''class Foo<T,U> {
           var t: T?
           var u: U?
           init() { t = nil; u = nil }
           init(_ x: T, _ y: U) { t = x; u = y }
        };(Foo<String,Double>(),Foo<Double,String>(3.14,"hello"))''',
            patterns=[
                r'\$R0: \(Foo<String, Double>, Foo<Double, String>\) = {',
                r'0 = {',
                r't = nil',
                r'u = nil',
                r'1 = {',
                r't = 3\.14[0-9]+', 'u = "hello"'])

## Instruction:
Revert "Disable test that fails on bot"
## Code After:
"""Test that we can correctly handle a nested generic type."""

import lldbsuite.test.lldbrepl as lldbrepl
import lldbsuite.test.decorators as decorators


class REPLBasicTestCase(lldbrepl.REPLTest):

    mydir = lldbrepl.REPLTest.compute_mydir(__file__)

    def doTest(self):
        self.command(
            '''class Foo<T,U> {
           var t: T?
           var u: U?
           init() { t = nil; u = nil }
           init(_ x: T, _ y: U) { t = x; u = y }
        };(Foo<String,Double>(),Foo<Double,String>(3.14,"hello"))''',
            patterns=[
                r'\$R0: \(Foo<String, Double>, Foo<Double, String>\) = {',
                r'0 = {',
                r't = nil',
                r'u = nil',
                r'1 = {',
                r't = 3\.14[0-9]+', 'u = "hello"'])
