Skip to content

Commit

Permalink
iesave run : add test for fix to #347
Browse files Browse the repository at this point in the history
  • Loading branch information
kbjarkefur committed Oct 11, 2023
1 parent fff3a49 commit 65917e1
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions run/iesave/iesave1.do
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,34 @@
version(`stata_ver')
assert _rc == 459

/*********************
Mutliple IDvars with missing values
*********************/

* Load auto
sysuse auto, clear

* Create ids that are only unique in combination
gen village = foreign
sort village make
by village : gen village_hhid = _n

* First test that it works without missing
iesave "`version_folder'/id_3.dta", ///
idvars(village village_hhid) version(15) replace

*Add this file to list of expected files
local expected_files `"`expected_files' "id_3.dta""'

* Create some missing vars
replace village = . in 5
replace village_hhid = . in 65

* Run iesave and test for expected error
cap iesave "~/delete-out/err_id_3.dta", ///
idvars(village village_hhid) version(15) replace
assert _rc == 459

/*********************
absence of userinfo
*********************/
Expand Down

0 comments on commit 65917e1

Please sign in to comment.