Update multiple-apps examples and eval (WIP)

This commit is contained in:
Timothyxxx
2024-03-02 20:41:01 +08:00
parent 0554703c01
commit 9c5269be3a
7 changed files with 316 additions and 16 deletions

View File

@@ -1,5 +1,7 @@
import copy
import json
from typing import Dict
import json, copy
def check_json_keybindings(actual: str, expected: str, **options) -> float:
"""
@@ -10,6 +12,7 @@ def check_json_keybindings(actual: str, expected: str, **options) -> float:
Return:
float: the score
"""
def direct_load_json(fp):
try:
with open(fp, 'r') as f:
@@ -17,7 +20,7 @@ def check_json_keybindings(actual: str, expected: str, **options) -> float:
return data
except:
return None
def skip_first_line_load_json(fp):
try:
with open(fp, 'r') as f:
@@ -54,7 +57,7 @@ def check_json_settings(actual: str, expected: str, **options) -> float:
with open(actual, 'r') as f:
data = json.load(f)
expect = expected['expected']
data_copy = copy.deepcopy(data)
data_copy.update(expect)
@@ -128,3 +131,11 @@ def is_extension_installed(actual: str, rules: Dict, **options):
return 0.0
else:
raise NotImplementedError
def check_python_file_by_test_suite(actual_file, test_suites, **options) -> float:
pass
def check_python_file_by_gold_file(actual_file, gold_file: str, **options) -> float:
pass