Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.24 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.24 KB

Tests of Ulf Wigers parse_trans package

  1. Installation

  1. Parent child

The first test contains the two files parent.erl and child.erl.

The file parent.erl contains a function (foo/1) that is neither used nor exported. The transform (transform_parent.erl) simply exports that function.

The file child .erl calls foo/1 locally, even if it does not exist. This call is replaced by parent:foo/1. So - when running child:bar/0, then parent:foo/1 is called instead.

  1. Parent child 2

This is a similar example as the one above. But, instaed of manipulating the export and calls we actually inline code from the parent to the child. This means that the code for foo/1 is copied from parent to child.

  1. exprecs

The second test contains the two files recorder.erl and test_recorder.erl.

The first file implements a simple exprecs module, which automatically creates access functions to records.

The second file is a test for the functionality.