aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs91
1 files changed, 86 insertions, 5 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
index 71983b3..f25f290 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/Tests/JsonStoreScriptModuleTests.cs
@@ -415,7 +415,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
415 } 415 }
416 416
417 // Commented out as this currently unexpectedly fails. 417 // Commented out as this currently unexpectedly fails.
418 // Test setting a key containing periods. 418 // Test setting a key containing periods with delineation
419// { 419// {
420// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); 420// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
421// 421//
@@ -426,7 +426,64 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
426// Assert.That(value, Is.EqualTo("Times")); 426// Assert.That(value, Is.EqualTo("Times"));
427// } 427// }
428 428
429 // Test setting a key containing empty brackets 429 // *** Test [] ***
430
431 // Test setting a key containing unbalanced ] without delineation. Expecting failure
432 {
433 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
434
435 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun]Circus", "Times");
436 Assert.That(result, Is.EqualTo(0));
437
438 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun]Circus");
439 Assert.That(value, Is.EqualTo(""));
440 }
441
442 // Test setting a key containing unbalanced [ without delineation. Expecting failure
443 {
444 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
445
446 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun[Circus", "Times");
447 Assert.That(result, Is.EqualTo(0));
448
449 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun[Circus");
450 Assert.That(value, Is.EqualTo(""));
451 }
452
453 // Test setting a key containing unbalanced [] without delineation. Expecting failure
454 {
455 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
456
457 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun[]Circus", "Times");
458 Assert.That(result, Is.EqualTo(0));
459
460 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun[]Circus");
461 Assert.That(value, Is.EqualTo(""));
462 }
463
464 // Test setting a key containing unbalanced ] with delineation
465 {
466 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
467
468 int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun]Circus}", "Times");
469 Assert.That(result, Is.EqualTo(1));
470
471 string value = (string)InvokeOp("JsonGetValue", storeId, "{Fun]Circus}");
472 Assert.That(value, Is.EqualTo("Times"));
473 }
474
475 // Test setting a key containing unbalanced [ with delineation
476 {
477 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
478
479 int result = (int)InvokeOp("JsonSetValue", storeId, "{Fun[Circus}", "Times");
480 Assert.That(result, Is.EqualTo(1));
481
482 string value = (string)InvokeOp("JsonGetValue", storeId, "{Fun[Circus}");
483 Assert.That(value, Is.EqualTo("Times"));
484 }
485
486 // Test setting a key containing empty balanced [] with delineation
430 { 487 {
431 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); 488 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
432 489
@@ -438,7 +495,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
438 } 495 }
439 496
440 // Commented out as this currently unexpectedly fails. 497 // Commented out as this currently unexpectedly fails.
441// // Test setting a key containing brackets with an integer 498// // Test setting a key containing brackets around an integer with delineation
442// { 499// {
443// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); 500// UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
444// 501//
@@ -449,6 +506,30 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
449// Assert.That(value, Is.EqualTo("Times")); 506// Assert.That(value, Is.EqualTo("Times"));
450// } 507// }
451 508
509 // *** Test {} ***
510
511 // Test setting a key containing unbalanced } without delineation. Expecting failure (?)
512 {
513 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
514
515 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun}Circus", "Times");
516 Assert.That(result, Is.EqualTo(0));
517
518 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun}Circus");
519 Assert.That(value, Is.EqualTo(""));
520 }
521
522 // Test setting a key containing unbalanced { without delineation. Expecting failure (?)
523 {
524 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
525
526 int result = (int)InvokeOp("JsonSetValue", storeId, "Fun{Circus", "Times");
527 Assert.That(result, Is.EqualTo(0));
528
529 string value = (string)InvokeOp("JsonGetValue", storeId, "Fun}Circus");
530 Assert.That(value, Is.EqualTo(""));
531 }
532
452 // Commented out as this currently unexpectedly fails. 533 // Commented out as this currently unexpectedly fails.
453// // Test setting a key containing unbalanced } 534// // Test setting a key containing unbalanced }
454// { 535// {
@@ -461,7 +542,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
461// Assert.That(value, Is.EqualTo("Times")); 542// Assert.That(value, Is.EqualTo("Times"));
462// } 543// }
463 544
464 // Test setting a key containing unbalanced { 545 // Test setting a key containing unbalanced { with delineation
465 { 546 {
466 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); 547 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
467 548
@@ -472,7 +553,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore.Tests
472 Assert.That(value, Is.EqualTo("Times")); 553 Assert.That(value, Is.EqualTo("Times"));
473 } 554 }
474 555
475 // Test setting a key containing balanced {}. This should fail. 556 // Test setting a key containing balanced {} with delineation. This should fail.
476 { 557 {
477 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}"); 558 UUID storeId = (UUID)InvokeOp("JsonCreateStore", "{}");
478 559