Ejemplo n.º 1
0
 def testCanParseFile(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, 'FileTwo.fs')
         s.parse(p)
         response = s.read_line()
         # XXX: Why in all caps?
         self.assertEqual(response['Kind'], 'INFO')
     finally:
         s.stop()
Ejemplo n.º 2
0
 def testCanParseFile(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, "FileTwo.fs")
         s.parse(p)
         response = s.read_line()
         # XXX: Why in all caps?
         self.assertEqual(response["Kind"], "INFO")
     finally:
         s.stop()
Ejemplo n.º 3
0
 def testCanRetrieveDeclarations(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, "FileTwo.fs")
         s.parse(p)
         _ = s.read_line()
         s.declarations(p)
         response = s.read_line()
         self.assertEqual(response["Kind"], "declarations")
     finally:
         s.stop()
Ejemplo n.º 4
0
 def testCanRetrieveTooltip(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, "FileTwo.fs")
         s.parse(p)
         _ = s.read_line()
         s.tooltip(p, 12, 9)
         response = s.read_line()
         self.assertEqual(response["Kind"], "tooltip")
     finally:
         s.stop()
Ejemplo n.º 5
0
 def testCanRetrieveDeclarations(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, 'FileTwo.fs')
         s.parse(p)
         _ = s.read_line()
         s.declarations(p)
         response = s.read_line()
         self.assertEqual(response['Kind'], 'declarations')
     finally:
         s.stop()
Ejemplo n.º 6
0
 def testCanRetrieveTooltip(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, 'FileTwo.fs')
         s.parse(p)
         _ = s.read_line()
         s.tooltip(p, 12, 9)
         response = s.read_line()
         self.assertEqual(response['Kind'], 'tooltip')
     finally:
         s.stop()
Ejemplo n.º 7
0
 def testCanRetrieveCompletions(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, "FileTwo.fs")
         s.parse(p)
         _ = s.read_line()
         s.completions(p, 12, 9)
         helptext = s.read_line()
         completions = s.read_line()
         self.assertEqual(helptext["Kind"], "helptext")
         self.assertEqual(completions["Kind"], "completion")
     finally:
         s.stop()
Ejemplo n.º 8
0
 def testCanRetrieveCompletions(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, 'FileTwo.fs')
         s.parse(p)
         _ = s.read_line()
         s.completions(p, 12, 9)
         helptext = s.read_line()
         completions = s.read_line()
         self.assertEqual(helptext['Kind'], 'helptext')
         self.assertEqual(completions['Kind'], 'completion')
     finally:
         s.stop()
Ejemplo n.º 9
0
 def testCanFindDeclaration(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, "FileTwo.fs")
         p2 = os.path.join(DATA_DIR, "Script.fsx")
         p3 = os.path.join(DATA_DIR, "Program.fs")
         s.project(p)
         _ = s.read_line()
         s.parse(p)
         _ = s.read_line()
         s.parse(p2)
         _ = s.read_line()
         s.parse(p3)
         _ = s.read_line()
         s.find_declaration(p3, 5, 15)
         response = s.read_line()
         self.assertEqual(response["Kind"], "finddecl")
     finally:
         s.stop()
Ejemplo n.º 10
0
 def testCanFindDeclaration(self):
     try:
         cmd, args = self.cmd_line
         s = Server(cmd, *args)
         s.start()
         p = os.path.join(DATA_DIR, 'FileTwo.fs')
         p2 = os.path.join(DATA_DIR, 'Script.fsx')
         p3 = os.path.join(DATA_DIR, 'Program.fs')
         s.project(p)
         _ = s.read_line()
         s.parse(p)
         _ = s.read_line()
         s.parse(p2)
         _ = s.read_line()
         s.parse(p3)
         _ = s.read_line()
         s.find_declaration(p3, 5, 15)
         response = s.read_line()
         self.assertEqual(response['Kind'], 'finddecl')
     finally:
         s.stop()