Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
1.8 kB · 49 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950import albedo/harness/extensionsimport albedo/harness/extensions/instructions/extension as instructionsimport gleam/listimport gleam/stringimport gleeunit/should
@external(erlang, "albedo_instructions_test_support", "fixture")fn fixture() -> #(String, String, String)
@external(erlang, "albedo_instructions_test_support", "empty_fixture")fn empty_fixture() -> #(String, String, String)
@external(erlang, "albedo_instructions_test_support", "cleanup")fn cleanup(root: String) -> Nil
pub fn installed_and_enabled_by_default_test() { let config = extensions.defaults() config.extensions |> list.map(fn(extension) { extension.name }) |> list.contains("instructions") |> should.be_true config.default_enabled |> list.contains("instructions") |> should.be_true}
pub fn project_and_global_files_are_concatenated_with_scope_test() { let #(root, project, home) = fixture() let assert Ok(context) = instructions.load_at(project, home)
string.contains(context, "## Project-level conventions") |> should.be_true string.contains(context, "root project convention") |> should.be_true string.contains(context, "nested project convention") |> should.be_true string.contains(context, "albedo project convention") |> should.be_true string.contains(context, "## Global user preferences") |> should.be_true string.contains(context, "global preference one") |> should.be_true string.contains(context, "global preference two") |> should.be_true string.contains(context, "must not load") |> should.be_false context |> string.split("### AGENTS.md") |> list.length |> should.equal(2)
cleanup(root)}
pub fn no_instruction_files_produce_no_context_test() { let #(root, project, home) = empty_fixture() instructions.load_at(project, home) |> should.equal(Ok("")) cleanup(root)}