ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - MainShayne233/markdown_test: Test the Elixir code in your markdown files!
Test the Elixir code in your markdown files! Contribute to MainShayne233/markdown_test development by creating an account on GitHub.
Visit Site

GitHub - MainShayne233/markdown_test: Test the Elixir code in your markdown files!

GitHub - MainShayne233/markdown_test: Test the Elixir code in your markdown files!

MarkdownTest

Build Status Coverage Status Hex Version

Test the Elixir code in your markdown!

Usage

Add :markdown_test as a dependency in your mix.exs file:

# mix.exs

defp deps do
  [
    {:markdown_test, "0.1.2", only: :test}
  ]
end

In any test module, use MarkdownTest to pull in the test_markdown/1 macro and call it for your markdown file:

defmodule MyLibraryTest do
  use MarkdownTest

  test_markdown("README.md")
end

Then add some Elixir code to test in your markdown file.

The format roughly resembles that of a doctest.

In order to be picked up, a code block must be between the following markdown comment tags:

<!--- MARKDOWN_TEST_START -->

...code

<!--- MARKDOWN_TEST_END -->.

Examples

iex> 1 + 2
3

The expression and expected values can span multiple lines:

iex> a = %{cool: :beans}
...> b = %{beans: :cool}
...> Map.merge(a, b)
%{
  cool: :beans,
  beans: :cool
}

You can also include any setup code that needs to be run prior to testing the code:

defmodule MyModule do
  def add(x, y), do: x + y
end

iex> MyModule.add(1, 2)
3

markdown_test will assert that the expression and the expected value match according to Elixir's pattern matching.

Therefore, you can write a test like this:

defmodule MyModule do
  def big_result do
    {:ok, List.duplicate("hey", 1000)}
  end
end

iex> MyModule.big_result()
{:ok, ["hey" | _]}

If you don't add any assertion code, markdown_test will just verify that the code snippet compiles, like:

%{
  this: %{
    "should" => :compile
  }
}

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory