lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.tests.lsp.ErrorInserter.AlteredTest Class Reference

An AlteredTest represents an altered version of what was a valid LF file. More...

Inherits Closeable.

Public Member Functions

void close () throws IOException
 Restore the file associated with this test to its original state.
ImmutableList< Integer > getBadLines ()
 Return the lines where this differs from the test from which it was derived.
Path getSrcFile ()
 Return the location where the content of this lives.
void insert (String line, Random random)
 Attempt to insert a new line of target language code into this test.
void replace (Function< String, String > replacer, Random random)
 Attempt to replace a line of this test with a different line of target language code.
String toString ()
void write () throws IOException
 Write the altered version of the test to the file system.

Detailed Description

An AlteredTest represents an altered version of what was a valid LF file.

Member Function Documentation

◆ close()

void org.lflang.tests.lsp.ErrorInserter.AlteredTest.close ( ) throws IOException

Restore the file associated with this test to its original state.

◆ getBadLines()

ImmutableList< Integer > org.lflang.tests.lsp.ErrorInserter.AlteredTest.getBadLines ( )

Return the lines where this differs from the test from which it was derived.

◆ getSrcFile()

Path org.lflang.tests.lsp.ErrorInserter.AlteredTest.getSrcFile ( )

Return the location where the content of this lives.

◆ insert()

void org.lflang.tests.lsp.ErrorInserter.AlteredTest.insert ( String line,
Random random )

Attempt to insert a new line of target language code into this test.

Parameters
lineThe line to be inserted.
randomRandom number generator.

◆ replace()

void org.lflang.tests.lsp.ErrorInserter.AlteredTest.replace ( Function< String, String > replacer,
Random random )

Attempt to replace a line of this test with a different line of target language code.

Parameters
replacerA function that replaces lines of code with possibly different lines.
randomRandom number generator.

◆ toString()

String org.lflang.tests.lsp.ErrorInserter.AlteredTest.toString ( )

◆ write()

void org.lflang.tests.lsp.ErrorInserter.AlteredTest.write ( ) throws IOException

Write the altered version of the test to the file system.

Exceptions
IOExceptionIf an I/O error occurred.

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/integrationTest/java/org/lflang/tests/lsp/ErrorInserter.java