Record Class ErrorExamples.ExampleUnit
java.lang.Object
java.lang.Record
org.ek9lang.compiler.common.ErrorExamples.ExampleUnit
- Record Components:
code- the error codename-bad,goodorgood_<suffix>files- its files: the failing file first (for a failing example), then the others in manifest order, those underdev/last
- Enclosing class:
ErrorExamples
public static record ErrorExamples.ExampleUnit(String code, String name, List<ErrorExamples.ErrorExample> files, List<ErrorExamples.ErrorExample> data, ErrorExamples.ErrorExample capture)
extends Record
One example of a code: a single file (
bad.ek9, good_open.ek9) or a directory (bad/,
good/) whose files compile together as one workspace.-
Constructor Summary
ConstructorsConstructorDescriptionExampleUnit(String code, String name, List<ErrorExamples.ErrorExample> files) An example of sources only: no companion file, no golden output.ExampleUnit(String code, String name, List<ErrorExamples.ErrorExample> files, List<ErrorExamples.ErrorExample> data, ErrorExamples.ErrorExample capture) Creates an instance of aExampleUnitrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncapture()Returns the value of thecapturerecord component.The golden output of the run, as stored (scrubbed), when this is a test-runner example with one.code()Returns the value of thecoderecord component.The files a failing example's directive file is compiled WITH: its other files.data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.failing()The file whose@Errordirective the failing example is checked by.The paths of its files within the code's directory - what a workspace of the code's directory narrows to.files()Returns the value of thefilesrecord component.final inthashCode()Returns a hash code value for this object.booleanisBad()True for the code's failing example.booleanTrue for a directory example.booleanisGood()True for one of the code's fixes.booleanisRunner()True for a test-runner example: the codesek9 -treports, shown by a run of the binary.name()Returns the value of thenamerecord component.The codes a failing example reports: its@Errordirectives, or - for a test-runner example, which has none - the code it is filed under.The arguments of theek9run that demonstrates this example, when it is a test-runner example (ErrorExamples.CLI_RUN); empty for an example the compiler judges.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ExampleUnit
An example of sources only: no companion file, no golden output. -
ExampleUnit
public ExampleUnit(String code, String name, List<ErrorExamples.ErrorExample> files, List<ErrorExamples.ErrorExample> data, ErrorExamples.ErrorExample capture) Creates an instance of aExampleUnitrecord class.
-
-
Method Details
-
isBad
public boolean isBad()True for the code's failing example. -
isGood
public boolean isGood()True for one of the code's fixes. -
isDirectory
public boolean isDirectory()True for a directory example. -
failing
The file whose@Errordirective the failing example is checked by.- Throws:
IllegalStateException- when this is a fix, or not exactly one of its files carries a directive
-
companions
The files a failing example's directive file is compiled WITH: its other files. -
fileNames
-
runnerArgs
The arguments of theek9run that demonstrates this example, when it is a test-runner example (ErrorExamples.CLI_RUN); empty for an example the compiler judges. -
isRunner
public boolean isRunner()True for a test-runner example: the codesek9 -treports, shown by a run of the binary. -
reportedCodes
-
captureText
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
code
-
name
-
files
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
capture
Returns the value of thecapturerecord component.- Returns:
- the value of the
capturerecord component
-