From e691b2643d4a20ffc9af689aa9d687629319f003 Mon Sep 17 00:00:00 2001 From: MilesCranmer Date: Sun, 30 Jun 2024 23:31:03 +0100 Subject: [PATCH] move generated docs test to other file --- test/advanced.jl | 42 +------------------------------------ test/test_generated_docs.jl | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 41 deletions(-) create mode 100644 test/test_generated_docs.jl diff --git a/test/advanced.jl b/test/advanced.jl index fcea32d..d0e2190 100644 --- a/test/advanced.jl +++ b/test/advanced.jl @@ -103,45 +103,5 @@ using Test #src @test !Interfaces.test(Group.GroupInterface, Int, int_pairs) #src @test_throws ArgumentError Interfaces.test(Group.GroupInterface, Float64, int_pairs) #src -# Test generated docs -expected_extended_help = """# Extended help +include("test_generated_docs.jl") #src -## Mandatory keys: - -* `neutral_check`: - * neutral stable -* `multiplication_check`: - * multiplication stable -* `inversion_check`: - * inversion stable - * inversion works""" - -@test strip(Interfaces._extended_help(Group.GroupInterface)) == strip(expected_extended_help) - - -expected_docs = """``` - GroupInterface -``` - -An Interfaces.jl `Interface` with mandatory components `(:neutral_check, :multiplication_check, :inversion_check)` and optional components `()`. - -A group is a set of elements with a neutral element where you can perform multiplications and inversions. - -The conditions checking the interface accept an `Arguments` object with two fields named `x` and `y`. The type of the first field `x` must be the type you wish to declare as implementing `GroupInterface`. - -# Extended help - -## Mandatory keys: - - * `neutral_check`: - - * neutral stable - * `multiplication_check`: - - * multiplication stable - * `inversion_check`: - - * inversion stable - * inversion works""" - -@test strip(string(@doc Group.GroupInterface)) == strip(expected_docs) diff --git a/test/test_generated_docs.jl b/test/test_generated_docs.jl new file mode 100644 index 0000000..7199c98 --- /dev/null +++ b/test/test_generated_docs.jl @@ -0,0 +1,42 @@ +expected_extended_help = """# Extended help + +## Mandatory keys: + +* `neutral_check`: + * neutral stable +* `multiplication_check`: + * multiplication stable +* `inversion_check`: + * inversion stable + * inversion works""" + +@test strip(Interfaces._extended_help(Group.GroupInterface)) == strip(expected_extended_help) + + +expected_docs = """``` + GroupInterface +``` + +An Interfaces.jl `Interface` with mandatory components `(:neutral_check, :multiplication_check, :inversion_check)` and optional components `()`. + +A group is a set of elements with a neutral element where you can perform multiplications and inversions. + +The conditions checking the interface accept an `Arguments` object with two fields named `x` and `y`. The type of the first field `x` must be the type you wish to declare as implementing `GroupInterface`. + +# Extended help + +## Mandatory keys: + + * `neutral_check`: + + * neutral stable + * `multiplication_check`: + + * multiplication stable + * `inversion_check`: + + * inversion stable + * inversion works""" + +@test strip(string(@doc Group.GroupInterface)) == strip(expected_docs) +