(For Alex) Add unit test for labeling.

@lopatin