# Testing for docstring

**URL:** <https://discourse.julialang.org/t/testing-for-docstring/2992>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 31, 2017, 6:22pm UTC](https://discourse.julialang.org/t/testing-for-docstring/2992 "2017-03-31T18:22:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [March 31, 2017, 6:22pm UTC](https://discourse.julialang.org/t/testing-for-docstring/2992/1 "2017-03-31T18:22:10Z")

</div>

How can I test that a macro assigns the right docstring to an object? MWE (without the macro, just the test):

```julia
"My docstring"
immutable MyType end

@doc(MyType) == doc"My docstring" # false, how can I make it true?

```

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [March 31, 2017, 6:26pm UTC](https://discourse.julialang.org/t/testing-for-docstring/2992/2 "2017-03-31T18:26:33Z")

</div>

```julia
repr(@doc(MyType))

```

Have also a look to `test/docs.jl` in Julia code, there is another solution based on `show` and Markdown MIME
