-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript #306
base: main
Are you sure you want to change the base?
Typescript #306
Conversation
First example v21
./payroll temp_payroll_input_7ccdb2f020a63a7f.txt libcob: error: module 'C$GETARG' not found so need to fix this.
DEBUG: Raw record read = [E001 04000025.0000100.00] E001 ,0001000.00,0000900.00 DEBUG: Raw record read = [E002 03500030.0000150.00] E002 ,0001050.00,0000900.00 DEBUG: Raw record read = [E003 04500020.0000090.00] E003 ,0000900.00,0000810.00 DEBUG: Raw record read = [E004 05000022.5000120.00] E004 ,0001125.00,0001005.00
Python and Cobol outputs are now the same.
🧪 Benchify Analysis of PR
|
Status | Property Name | Example Input | # Inputs Tested | Explanation |
---|---|---|---|---|
❌ | Response contains ShardId | stream_name='' data={} |
3 | The put_record_to_kinesis function failed when called with an empty stream_name and an empty data dictionary, because the stream_name parameter has a minimum length requirement of 1, because the stream_name cannot be empty. |
❌ | COBOL Compiler Installation Error Handling | os_name='Linux' |
1 | The test failed because the platform module does not have a linux_distribution attribute, which is being patched in the test. This attribute was removed in Python 3.9, so the test is not compatible with the current Python version. The install_cobc_and_compile_script function is not being called due to this error, so the expected subprocess.CalledProcessError is not being raised. Instead, an AttributeError is raised when trying to patch the non-existent linux_distribution attribute. |
✅ | Valid input returns 7-character string | num=0.0 |
200 | The format_pic_9_5_v_99 function correctly returned a 7-character string for the input num=0.0 , meeting the expected length requirement. |
✅ | getStringDistance is non-negative |
superjson.parse('{"json":[["o[2}",":1\'8;amT-LM... view full input |
200 | The getStringDistance function correctly calculated the Levenshtein distance between str1 and str2 as a non-negative value for all tested string pairs, including the example inputs str1 = "o[2" and str2 = ":1'8;amT-LM" . |
Reproducible Unit Tests
# Unit Test for "Response contains ShardId": The response from `put_record_to_kinesis` should always contain a `ShardId` key, indicating that the record was successfully placed in a shard of the Kinesis stream.
def benchify_test_response_contains_shard_id(stream_name, data):
response = put_record_to_kinesis(stream_name, data)
assert 'ShardId' in response
def benchify_test_response_contains_shard_id_exec_test_failing_0():
stream_name=''
data={}
benchify_test_response_contains_shard_id(stream_name, data)
# Unit Test for "COBOL Compiler Installation Error Handling": The function should raise a subprocess.CalledProcessError if the installation of the GNU COBOL compiler fails due to an unsupported Linux distribution or any other installation error.
def benchify_test_install_cobc_unsupported_linux_distribution(os_name):
with patch('platform.system', return_value=os_name), \
patch('platform.linux_distribution', return_value=('unsupported', '', '')):
with pytest.raises(Exception, match='Unsupported Linux distribution'):
install_cobc_and_compile_script()
def benchify_test_install_cobc_unsupported_linux_distribution_exec_test_failing_0():
os_name='Linux'
benchify_test_install_cobc_unsupported_linux_distribution(os_name)
# Unit Test for "Valid input returns 7-character string": The function should return a 7-character string with leading zeros for valid inputs within the range of 0 to 99999.99.
def benchify_test_format_pic_9_5_v_99_valid_input(num):
result = format_pic_9_5_v_99(num)
assert len(result) == 7
def benchify_test_format_pic_9_5_v_99_valid_input_exec_test_passing_0():
num=0.0
benchify_test_format_pic_9_5_v_99_valid_input(num)
// Unit Test for "`getStringDistance` is non-negative": The Levenshtein distance between any two strings is always non-negative.
function benchify_str1(str1, str2) {
const distance = getStringDistance(str1, str2);
expect(distance).toBeGreaterThanOrEqual(0);
}
it('benchify_str1_exec_test_passing_0', () => {
const args = superjson.parse('{"json":[["o[2}",":1\'8;amT-LM"]]}');
benchify_str1(...args);
});
@Benchify test |
Benchify ran into an issue while running the
|
No description provided.