안녕하세요,
많은 셀에서 테이블을 조작하는 모듈에 대한 단위 테스트를 만들고 싶습니다. 그래서 나는 테이블의 체크섬에 대해 테스트하려고 생각했습니다.
즉시 사용 가능한 테이블에 대한 체크섬을 제공하는 함수를 찾을 수 없습니다.
누구든지 그것을하는 방법을 깔끔한 생각을 가지고 있습니까?
친애하는
스테판
BlobMD5 기능을 사용하는 것이 좋습니다. JMP가 디스크의 이진 데이터에 날짜를 추가하거나 차후 릴리스에서 형식을 변경하기 때문에 테이블의 디스크 이미지가 아닌 테이블 내부의 데이터를 체크섬 할 수 있습니다. 첫 번째 예는 아마도 단위 테스트에 필요한 것이 아닙니다.
// capture the md5 of the data the table saves to disk
Show(
Hex(/* make it printable */
Blob MD5(/* get the hash */
Load Text File(
"$SAMPLE_DATA/big class.jmp",
BLOB/* the result is a BLOB, not a string */
)
)
)
);
// capture the md5 of the script that will produce the table
dt = Open( "$SAMPLE_DATA/big class.jmp" );
Show( Hex( Blob MD5( Char To Blob( Char( dt << getscript ) ) ) ) );
// capture the md5 of some numeric columns in the table; avoids numeric to character conversions
Show( Hex( Blob MD5( Matrix To Blob( dt[0, {height, age, weight}], "float", 8, "little" ) ) ) );
// capture the md5 of some mixed columns in the table
Show( Hex( Blob MD5( Char To Blob( Char( dt[0, {name, height, age, weight}] ) ) ) ) );