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 d378e21 commit 9dcb3adCopy full SHA for 9dcb3ad
spec/import_spec.moon
@@ -0,0 +1,26 @@
1
+describe "import", ->
2
+ it "should import from table", ->
3
+ import sort, insert from table
4
+ t = { 4,2,6 }
5
+ insert t, 1
6
+ sort t
7
+
8
+ assert.same t, {1,2,4,6}
9
10
+ it "should import from local", ->
11
+ thing = { var: 10, hello: "world", func: => @var }
12
+ import hello, \func from thing
13
14
+ assert.same hello, thing.hello
15
+ assert.same func!, thing.var
16
17
+ it "should not call source multiple times", ->
18
+ count = 0
19
+ source = ->
20
+ count += 1
21
+ { hello: "world", foo: "bar" }
22
23
+ import hello, foo from source!
24
25
+ assert.same count, 1
26
0 commit comments