Skip to content

Commit 91edd81

Browse files
committed
Test same hash as Node client
1 parent 7ab3716 commit 91edd81

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/models/feature_snapshot.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,14 @@ pub mod tests {
416416
assert!(matches!(value, Value::Int64(ref v) if v == &2));
417417
}
418418

419+
/// This test ensures that the rust client is using the same hashing algorithm as to other clients.
420+
/// See same test for Node client:
421+
/// https://github.com/IBM/appconfiguration-node-sdk/blob/master/test/unit/configurations/internal/utils.test.js#L25
422+
#[test]
419423
fn test_calculate_normalized_hash() {
420-
assert_eq!(calculate_normalized_hash(&"".to_string()), 41)
424+
assert_eq!(
425+
FeatureSnapshot::calculate_normalized_hash("entityId:featureId"),
426+
41
427+
)
421428
}
422429
}

0 commit comments

Comments
 (0)