elixir1.16 testing #742
5 changed files with 19 additions and 12 deletions
|
@ -7,6 +7,7 @@ matrix:
|
||||||
ELIXIR_VERSION:
|
ELIXIR_VERSION:
|
||||||
- 1.14
|
- 1.14
|
||||||
- 1.15
|
- 1.15
|
||||||
|
- 1.16
|
||||||
OTP_VERSION:
|
OTP_VERSION:
|
||||||
- 25
|
- 25
|
||||||
- 26
|
- 26
|
||||||
|
@ -17,6 +18,8 @@ matrix:
|
||||||
OTP_VERSION: 25
|
OTP_VERSION: 25
|
||||||
- ELIXIR_VERSION: 1.15
|
- ELIXIR_VERSION: 1.15
|
||||||
OTP_VERSION: 26
|
OTP_VERSION: 26
|
||||||
|
- ELIXIR_VERSION: 1.16
|
||||||
|
OTP_VERSION: 26
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &scw-secrets
|
- &scw-secrets
|
||||||
|
|
|
@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
- Support for [FEP-fffd](https://codeberg.org/fediverse/fep/src/branch/main/fep/fffd/fep-fffd.md) (proxy objects)
|
||||||
|
- Verified support for elixir 1.16
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
## Required dependencies
|
## Required dependencies
|
||||||
|
|
||||||
* PostgreSQL 9.6+
|
* PostgreSQL 9.6+
|
||||||
* Elixir 1.14+
|
* Elixir 1.14+ (currently tested up to 1.16)
|
||||||
* Erlang OTP 25+
|
* Erlang OTP 25+ (currently tested up to OTP26)
|
||||||
* git
|
* git
|
||||||
* file / libmagic
|
* file / libmagic
|
||||||
* gcc (clang might also work)
|
* gcc (clang might also work)
|
||||||
|
|
|
@ -53,12 +53,11 @@ def cast_data(data) do
|
||||||
|
|
||||||
defp fix_url(%{"url" => url} = data) when is_bitstring(url), do: data
|
defp fix_url(%{"url" => url} = data) when is_bitstring(url), do: data
|
||||||
defp fix_url(%{"url" => url} = data) when is_map(url), do: Map.put(data, "url", url["href"])
|
defp fix_url(%{"url" => url} = data) when is_map(url), do: Map.put(data, "url", url["href"])
|
||||||
|
|
||||||
defp fix_url(%{"url" => url} = data) when is_list(url) do
|
defp fix_url(%{"url" => url} = data) when is_list(url) do
|
||||||
if is_map(List.first(url)) do
|
data
|
||||||
Map.put(data, "url", List.first(url)["href"])
|
|> Map.put("url", List.first(url))
|
||||||
else
|
|> fix_url()
|
||||||
Map.put(data, "url", List.first(url))
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp fix_url(data), do: data
|
defp fix_url(data), do: data
|
||||||
|
|
|
@ -50,14 +50,17 @@ test "note with url array validates", %{note: note} do
|
||||||
end
|
end
|
||||||
|
|
||||||
test "note with url array validates if contains a link object", %{note: note} do
|
test "note with url array validates if contains a link object", %{note: note} do
|
||||||
note = Map.put(note, "url", [%{
|
note =
|
||||||
"type" => "Link",
|
Map.put(note, "url", [
|
||||||
"href" => "https://remote.example/link"
|
%{
|
||||||
}])
|
"type" => "Link",
|
||||||
|
"href" => "https://remote.example/link"
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
|
%{valid?: true} = ArticleNotePageValidator.cast_and_validate(note)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
test "a note with a language validates" do
|
test "a note with a language validates" do
|
||||||
insert(:user, %{ap_id: "https://mastodon.social/users/akkoma_ap_integration_tester"})
|
insert(:user, %{ap_id: "https://mastodon.social/users/akkoma_ap_integration_tester"})
|
||||||
note = File.read!("test/fixtures/mastodon/note_with_language.json") |> Jason.decode!()
|
note = File.read!("test/fixtures/mastodon/note_with_language.json") |> Jason.decode!()
|
||||||
|
|
Loading…
Reference in a new issue