Skip to content

azoth-lang/azoth.language.tests

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azoth Language Tests

These tests verify a compiler/implementation of the Azoth language. They are written so they do not rely on the Azoth standard library or any other Azoth packages. They are truly a test of the language only and not of any of the standard library or package ecosystem. However, the tests do require a special test package to be provided by the test harness/platform. This is a minimal package that must be implemented. It is intentionally kept small to make implementing a test harness easy.

Test Package

The test package consists of two type declarations in the global namespace, extensions to the simple types for conversion to string, and any necessary implementation. The two types are a simplified string struct and a TestOutput trait to in lieu of console output.

Strings

The string struct provided by the test harness should be equivalent to the implementation below. More methods will likely be necessary internally to support other functionality in the test package.

published copy struct string
{
    public let bytes: const Raw_Array[byte];

    public new(.bytes) { }

    published implicit operator "_"(value: const Raw_Array[byte]) -> string
    {
        return new string(value);
    }
}

Test Output

The TestOutput trait provided by the test package must match the declaration below. This is a capability accepted by the main function.

published trait TestOutput
{
    published fn write(mut self, value: string);

    published fn write_line(mut self, line: string);

    published fn write_line(mut self);
}

Convert to String

The boolean, integer, and floating point types should all the extended with a to_invariant_string() method converting them to a string in the invariant local.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published