We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfc165c commit 08d69e3Copy full SHA for 08d69e3
lib/elixir/test/elixir/record_test.exs
@@ -3,7 +3,7 @@ Code.require_file "test_helper.exs", __DIR__
3
defrecord RecordTest.FileInfo,
4
Record.extract(:file_info, from_lib: "kernel/include/file.hrl")
5
6
-defrecord RecordTest.SomeRecord, a: 0, b: 1
+defrecord RecordTest.SomeRecord, a: 0, b: &Dict.get/2
7
defrecord RecordTest.WithNoField, []
8
9
## Record import
@@ -130,6 +130,11 @@ defmodule RecordTest do
130
assert compose_dynamic(a: "a") == RecordTest.DynamicName[a: "a", b: "b"]
131
end
132
133
+ test :default_functions do
134
+ record = RecordTest.SomeRecord.new
135
+ assert is_function(record.b, 2)
136
+ end
137
+
138
test :to_keywords do
139
record = RecordTest.DynamicName.new(a: "a", b: "b")
140
assert record.to_keywords[:a] == "a"
0 commit comments