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
    • 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
  • Learn More about Wolfram Language

Mockingbird

Tutorials

  • WritingMockTestsWithMockingbird

Guides

  • Mockingbird

Symbols

  • MockDefinitionGroup
  • MockDefinition
  • MockEvaluate
  • MockEvaluateReap
  • MockPropertyValuePatternTest
  • MockPropertyValueQ
  • MockSow
Wolfram`Mockingbird`
MockEvaluate
​
MockEvaluate[defs,expr]
evaluates
expr
with mock definitions
defs
in place.
Details

Examples  
(6)
Basic Examples  
(2)
In[1]:=
Needs["Wolfram`Mockingbird`"]
Evaluate an expression using a mocked version of the function
f
:
In[2]:=
MockEvaluate
​​
MockDefinition
[f[x_]:=Expand[(x/2)^3]],​​f[a+b]​​
Out[2]=
3
a
8
+
3
2
a
b
8
+
3a
2
b
8
+
3
b
8
Outside of the mock evaluation,
f
is unmodified:
In[3]:=
f[a+b]
Out[3]=
f[a+b]
In[4]:=
DownValues[f]
Out[4]=
{}
———
Use
MockDefinitionGroup
to specify multiple, potentially interconnected definitions:
In[1]:=
MockEvaluate
​​
MockDefinitionGroup
[{​​f[x_]:=g[x^2],​​g[y_]:=y*2​​}],​​f[42]​​
Out[1]=
3528
Scope  
(1)

Options  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
MockDefinition
 
▪
MockDefinitionGroup
 
▪
MockEvaluateReap
TechNotes
▪
Writing Mock Tests with Mockingbird
RelatedGuides
▪
Mockingbird
▪
Writing Mock Tests with Mockingbird

© 2025 Wolfram. All rights reserved.

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