mirror of
https://github.com/kunkunsh/kunkun.git
synced 2025-04-20 05:29:17 +00:00
Fix test assertions in database module to use array indexing for results
format rust code
This commit is contained in:
parent
5d5cbcdeb7
commit
bf6aa1b419
@ -1108,8 +1108,8 @@ mod tests {
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(results.len(), 1);
|
||||
assert_eq!(results[0]["title"], "Buy groceries");
|
||||
assert_eq!(results[0]["completed"], "false");
|
||||
assert_eq!(results[0][0], "Buy groceries");
|
||||
assert_eq!(results[0][1], "false");
|
||||
|
||||
// Test execute with UPDATE
|
||||
let (rows_affected, _) = db
|
||||
@ -1127,7 +1127,7 @@ mod tests {
|
||||
vec![json!(1)],
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(results[0]["completed"], "true");
|
||||
assert_eq!(results[0][0], "true");
|
||||
|
||||
// Test execute with DELETE
|
||||
let (rows_affected, _) = db
|
||||
@ -1139,7 +1139,7 @@ mod tests {
|
||||
let results = db
|
||||
.select("SELECT COUNT(*) as count FROM todos".to_string(), vec![])
|
||||
.unwrap();
|
||||
assert_eq!(results[0]["count"], 0);
|
||||
assert_eq!(results[0][0], 0);
|
||||
|
||||
fs::remove_file(&db_path).unwrap();
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
## Permission Table
|
||||
|
||||
<table>
|
||||
@ -6,6 +7,7 @@
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
pub struct AppState {
|
||||
// pub history: Mutex<Vec<Record>>,
|
||||
// pub dev_extension_path: Mutex<Option<PathBuf>>,
|
||||
|
@ -2,10 +2,7 @@
|
||||
// use hello_world::{HelloReply, HelloRequest};
|
||||
// use server_info«::server_info_server::ServerInfo;
|
||||
// use server_info::{InfoRequest, InfoResponse};
|
||||
use grpc::kunkun::{
|
||||
kunkun_server::Kunkun,
|
||||
Empty, ServerInfoResponse,
|
||||
};
|
||||
use grpc::kunkun::{kunkun_server::Kunkun, Empty, ServerInfoResponse};
|
||||
|
||||
use tauri::{AppHandle, Emitter, Manager};
|
||||
use tonic::{Request, Response, Status};
|
||||
|
@ -6,8 +6,7 @@ use axum::routing::{get, post};
|
||||
use axum_server::tls_rustls::RustlsConfig;
|
||||
use base64::prelude::*;
|
||||
use grpc::{
|
||||
file_transfer::file_transfer_server::FileTransferServer,
|
||||
kunkun::kunkun_server::KunkunServer,
|
||||
file_transfer::file_transfer_server::FileTransferServer, kunkun::kunkun_server::KunkunServer,
|
||||
};
|
||||
/// This module is responsible for controlling the main server
|
||||
use obfstr::obfstr as s;
|
||||
|
@ -3,10 +3,8 @@ use super::{
|
||||
model::{ServerInfo, ServerState},
|
||||
};
|
||||
use crate::{
|
||||
constants::KUNKUN_REFRESH_WORKER_EXTENSION,
|
||||
models::FileTransferState,
|
||||
server::model::FileTransferProgressPayload,
|
||||
JarvisState,
|
||||
constants::KUNKUN_REFRESH_WORKER_EXTENSION, models::FileTransferState,
|
||||
server::model::FileTransferProgressPayload, JarvisState,
|
||||
};
|
||||
use axum::{
|
||||
body::StreamBody,
|
||||
|
Loading…
x
Reference in New Issue
Block a user