Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Sound & Video
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook

Mockingbird

Tutorials

  • WritingMockTestsWithMockingbird

Guides

  • Mockingbird

Symbols

  • MockDefinitionGroup
  • MockDefinition
  • MockEvaluate
  • MockEvaluateReap
  • MockPropertyValuePatternTest
  • MockPropertyValueQ
  • MockSow
Wolfram`Mockingbird`
MockSow
​
MockSow[e]
specifies that
e
should be collected by the nearest enclosing
MockEvaluateReap
.
​
MockSow[e,tag]
​ specifies that
e
should be collected by the nearest enclosing
MockEvaluateReap
whose pattern matches
tag
.
​
MockSow[e,{
tag
1
,
tag
2
,…}]
​ specifies that
e
should be collected once for each pattern that matches a
tag
i
.
Details

Examples  
(3)
Basic Examples  
(2)
In[1]:=
Needs["Wolfram`Mockingbird`"]
Sow an intermediate result during mock evaluation of the function
f
:
In[2]:=
MockEvaluateReap
​​
MockDefinition
f[x_]:=Expand
MockSow
[(x/2)^3],​​f[a+b]​​
Out[2]=

3
a
8
+
3
2
a
b
8
+
3a
2
b
8
+
3
b
8
,
1
8
3
(a+b)

———
Sow using a list of tags:
In[1]:=
MockEvaluateReap
​​
MockDefinition
g[x_,y_]:=Expand
MockSow
[x^2,{"x","squared"}]
MockSow
[y^3,{"y","cubed"}]
,​​g[x,y],​​All​​
Out[1]=

2
x
3
y
,x{
2
x
},squared{
2
x
},y{
3
y
},cubed{
3
y
}
Possible Issues  
(1)

SeeAlso
MockEvaluateReap
 
▪
Sow
 
▪
Reap
TechNotes
▪
Writing Mock Tests with Mockingbird
RelatedGuides
▪
Mockingbird
▪
Writing Mock Tests with Mockingbird

© 2023 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com